0
How come the comparison => can compare To all numbers
>>> 7 <= 8 True >>> 9 >= 9.0 True
1 Answer
+ 4
<= means less than or equal to, you get True for the 7 <= 8 expression because 7 is less than 8.
>= means greater than or equal to, so you get True for the 9 >= 9.0 expression, because 9 (int) is considered equal to 9.0 (float). If you compared 9 >= 9.01 you will get False as a result.
Hth, cmiiw