Operator Precedence | SoloLearn: Learn to code for FREE!


Operator Precedence

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

5/5/2020 7:51:49 AM

Syakirin Ooi

2 Answers

New Answer


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


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