0
What is difference between "is" and "=="?
Can anyone explain what is difference between "is" and "=="? example: x = 2 if x is 2: do something OR x = 2 if x == 2: do something
1 ответ
+ 3
the == operator compare the values
is operator check if the referenced objects are the same.
see this discussion: http://stackoverflow.com/questions/132988/is-there-a-difference-between-and-is-in-JUMP_LINK__&&__python__&&__JUMP_LINK