CBSE Class 12 Computer Science Question 62 of 105

Python Revision Tour — Question 16

Back to all questions
16
Question

Question 16

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
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