why print("2"+"5"==5*5) is false? | SoloLearn: Learn to code for FREE!


why print("2"+"5"==5*5) is false?

1/25/2017 2:56:42 PM


3 Answers

New Answer


The left-hand term is "25", which is a string, while the right-hand term is 25, which is an int.


The correct setence is ("2"+"5"==str(5*5))


When you evaluate "25" with 25 you are for sure going to get a false value. Because "2"+"5" is a string value, whereas 5*5(25) is an int value. If you compare int with string then it will obviously end up in False result. Hence write str before 5*5, i.e. print ("2" + "5" == str(5*%)), now here, both the values are string. Ans thus produces True