Boolean 7>7.0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Boolean 7>7.0

How is this "False"?

24th Jun 2017, 5:48 PM
John Sitther
3 Answers
+ 8
In math, 7 is equal to 7.0. So they're equal. In other words 7 is not greater than 7.0.
24th Jun 2017, 5:51 PM
Rrestoring faith
Rrestoring faith - avatar
+ 13
In simple words : 7 is an integer value where as 7.0 is a floating point value. An integer value is always > than the floating point value ^^
24th Jun 2017, 6:03 PM
Dev
Dev - avatar
0
Well in python terms , float always has a higher precedence than isn't data type , hence 7.0 is always greater than 7
28th Jun 2017, 4:14 PM
ismath
ismath - avatar