+ 1

Operator Precedence

I don't understand this concept: >>> False == False or True True >>> False == (False or True) False >>> (False == False) or True True

5th May 2020, 7:51 AM
Syakirin Ooi
Syakirin Ooi - avatar
2 Answers
+ 2
Everything that is in parenthesis"()" is operated first as it have highest precedence. Rest is performed from left to right. 1) False == False or True True or True (as False == False is true) >>>>True 2) False == (False or True) False == (True) >>>>False 3) (False == False) or True True or True >>>>True
5th May 2020, 7:58 AM
Arsenic
Arsenic - avatar
+ 2
What you didn't understand? In 1st == has higher precedence ,so that's why it evaluates to True ,in rest bracket ones are evaluated first
5th May 2020, 7:56 AM
Abhay
Abhay - avatar