0

Why print(2 > 4 == 4) is False? Please kindly explain me.

11th Feb 2023, 6:53 PM
TAEK
4 Respuestas
+ 4
Adding : > , == have equal precedence so evaluation happens left to right.. So first > evaluared . next == . so
11th Feb 2023, 7:06 PM
Jayakrishna 🇮🇳
+ 2
Because 2 > 4 = False means 0 So 0 == 4 False
11th Feb 2023, 6:57 PM
A͢J
A͢J - avatar
+ 1
You will need to prioritize the 4 == 4 equality check to achieve a True result. 2 > ( 4 == 4 ) 2 > ( True ) 2 > 1 True
12th Feb 2023, 6:30 AM
Ipang
+ 1
Because, True = 1 False = 0 2 > 4, False so its value equals to 0 Now, 0 == 4, False And also interpreter reads the code from left to right.
13th Feb 2023, 6:23 AM
Shiva :)
Shiva :) - avatar