+ 1

what happens when I compare an integer with whole number? example: 80>=80.0

8th Sep 2016, 4:30 PM
Sujit Sajja
Sujit Sajja - avatar
14 Respuestas
+ 4
it returns TRUE .. :)
28th Sep 2016, 2:08 PM
Somya Bhupal
Somya Bhupal - avatar
+ 1
it's True
8th Sep 2016, 4:43 PM
gala
gala - avatar
+ 1
true
10th Sep 2016, 5:23 AM
Vishnu ks
Vishnu ks - avatar
+ 1
your question is incorrect. integer is a wgole number. your example compares an integer and a float. and i'm pretty sure python just casts integer into float to compare the two.
14th Sep 2016, 12:53 AM
Artur Karlov
Artur Karlov - avatar
+ 1
These people lie. I have run the code three times, each time, it came back as no output. So...
12th Oct 2020, 7:50 PM
Zoriander
Zoriander  - avatar
0
It will return True. The interpreter is smart. :-p
21st Sep 2016, 7:46 AM
brain jethuri
brain jethuri - avatar
- 1
Since boolean comparison is performed and both the values are equal so it give output as: True
17th Sep 2016, 6:27 PM
MARCK PATEL
MARCK PATEL - avatar
- 1
returns true
19th Sep 2016, 6:44 PM
Vineet
- 1
just try it. ;) it returns true.
30th Sep 2016, 12:12 PM
Sophia
- 1
It will return true, because numbers like 18 and 18.0 are equal, one just has an unnecessary decimal.
19th Nov 2016, 2:14 PM
fighter_Ethan
- 1
true
8th Dec 2016, 10:31 AM
LINUX ELDER
LINUX ELDER - avatar
- 1
TRUE
17th Apr 2018, 12:44 PM
Jimu
Jimu - avatar
- 2
returns true. Python implicitly converts the int to whole number.
8th Sep 2016, 4:31 PM
Sujit Sajja
Sujit Sajja - avatar
- 2
naive
21st Sep 2016, 5:36 AM
kirito
kirito - avatar