Skip to content

Question 1

The following Python expression is entered into a fresh Python shell with no prior import statements. Determine the result from evaluating the following expression. [3 marks]

print(True or False and True)
Solution

Both or and and operators have the same precedence level, hence we work through this expression from left to right.

True or False and True
= True and True         # True or False = True
= True
Answer
True