creamidea / Mushroom

To display Node Capture Data and Control it
Other
0 stars 1 forks source link

String comparison in Python: is vs. == [duplicate] #29

Open creamidea opened 10 years ago

creamidea commented 10 years ago

what is different between 'is' and '=='

you should pay more attention to this:

a = 19998989890
b = 19998989889 +1
>>> a is b
False
>>> a == b
True

so, you know. The 'is' has more strict matching than '=='

Reference: http://stackoverflow.com/questions/2988017/string-comparison-in-python-is-vs