+ 1

Can you help me?

Why the compiler output this??? I am not understand,this is wrong!!!!! https://sololearn.com/compiler-playground/crypqhNsbh2o/?ref=app

27th Dec 2023, 8:41 PM
Yazan Alhallack
Yazan Alhallack - avatar
2 Respostas
+ 5
A little explanation on StuartH's answer. 1==0 >= False becomes 1==0 and 0 >= False becomes False and True which is False. 1!=2 >= False becomes 1 != 2 and 2 >= False becomes True and True which is True. In Python, 1 == True, 0 == False.
28th Dec 2023, 1:21 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 3
As I understand it, Python will split out chained comparisons as follows: 1==0 >= False becomes 1==0 and 0 >= False which is False. 1!=2 >= False becomes 1 != 2 and 2 >= False which is True.
27th Dec 2023, 11:06 PM
StuartH
StuartH - avatar