Skip to content

Question 2

Evaluate:

False and (1/0) > 10
Solution

For a compound expression joined by the and operator, if one side is False, the whole expression is rendered False. Consider the left-hand side (LHS) and right-hand side (RHS) of this compound expression:

  • LHS: False
  • RHS: (1/0) > 10 \(\Rightarrow\) ZeroDivisionError

However, we give priority to evaluating the LHS first over the RHS (i.e., short-circuiting technique for conditional statements in Python). In this case, given the logic of how the and operator naturally works, as soon as we find that the LHS is False, it does not really matter what the RHS is.

Answer
False