0
Why true false?
2==2.0 2 is 2.0
4 ответов
+ 2
Is checks if object a IS object b.
== checks if it is similar.
'Hey, that woman over there looks like your mom!'
'Ah, well, very strange indeed.' (==, woman looks the same, but isn't the same woman)
or:
'Oh, wow, that IS my mom! What's she doing here?!'
+ 1
2==2.0, but type(2)-int, type(2.0)-float and int != float
0
so “is” is actually comparing the data types ?