0
how is the output of print (2==2.0) true ?
2 Answers
+ 5
The result is True. This is something you can check easily by yourself by using the python console or the playground.
You compare the int value 2 with the float value 2.0. Both are 2, so the result is True.
+ 1
How not? It is better to add reason...
Equality operand compares here content only.....
2, 2.0 are not same value?
Pls tag the language?