Basic Python Syntax - Introduction to Syntax and Operators
Input: 10>10.0
Output: False
Why is it so?
Is it because of the size of the data types, one being int and the other being float?
1 answers ( 0 marked as helpful)
Hi Neelanjan,
thanks for being a part of our courses!
The reason you're getting a false when asking if 10 > 10.0 isn't to do with the types. It's because 10 is equal to 10.0. So, if you instead run :
10 == 10.0
you'd get a True response.
Cheers,
Eli