5 Answers
New AnswerBecause the value of x is String. If you do like this int(x) == y then you will get true. so here x = "4" + "5" = "45" y = 4 * 5 = 45 ("45" == 45) = false because you are Comparing String with number. (int("45") == 45) = true
Because one is string type and another is integer type.in line eight you enter ! which means not.so in line eight code says that str is not equal to integer,thats why output is false...
Add this after line 5 to see that both of them belong to different class types. print(type(x)) print(type(y)) x is string. y is integer.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message