KnowledgeBoat Logo
|

Computer Science

Consider the given expression: not True and False or True

Which of the following will be correct output if the given expression is evaluated?

  1. True
  2. False
  3. None
  4. Null

Python Funda

8 Likes

Answer

True

Reason — The 'not' operator has the highest precedence, followed by 'and', which has precedence over 'or', and the evaluation proceeds from left to right.

not True and False or True
= False and False or True
= False or True
= True

Answered By

2 Likes


Related Questions