Which of the following expressions in Python evaluates to True ?
Which of the following expressions in Python evaluates to True ?
Options
Option C — 3>1 and 3>2 evaluates to True, because both relational sub-expressions (3>1 and 3>2) are individually True, so their logical and is True.
Marking Scheme
- 11 mark: for correctly selecting option C.
Hint
Remember: `and` returns the actual second operand (not necessarily a boolean) if the first operand is truthy — check the literal output, not just truthiness.
Quick Oral Answer
Option C: 3>1 and 3>2 evaluates to True and True, which is True; the other options either give False or return a non-boolean truthy value.
Analysis & Explanation
This question tests precise evaluation of relational and logical (and) operators together, including the subtlety of Python's short-circuit behaviour.
Concept
andreturns the second operand if the first is truthy; the result is a strict boolean (True/False) only when both operands themselves are booleans.- Evaluate each option's operands strictly left to right.
Option-by-option evaluation
- A:
2>3 and 2<3→False and True→ short-circuits toFalse(first operand is False, soandreturns it directly). - B:
3>1 and 2→True and 2→ since the first operand is truthy,andreturns the second operand as-is, i.e., the integer2(not the booleanTrue) — truthy, but the expression does not literally evaluate toTrue. - C:
3>1 and 3>2→True and True→True. Correct. - D:
3>1 and 3<2→True and False→False.
Exam trap
- Many students think option B 'evaluates to True' because 2 is truthy; but the actual value RETURNED by
andin B is the integer2, not the booleanTrue, so B does not satisfy 'evaluates to True' literally.
Common Mistakes
- 1Believing option B evaluates to True because 2 is truthy — but `and` returns the actual operand value (2), not the boolean True.
- 2Not evaluating relational operators (>, <) before applying and.
Interesting Facts
In Python, `and` and `or` are short-circuit operators that return one of their operands (not necessarily True/False), unlike many other languages where logical operators always return a strict boolean.
This operand-returning behaviour of and/or is often used as a compact way to write default-value expressions, e.g., `x = a or default`.
Spotted a mistake or something unclear?
Tell us — we fix reported answers fast.
Frequently Asked Questions
Does 'and' in Python always return True or False?
No. Python's and operator returns one of its actual operands: if the first operand is falsy, it returns the first operand; if truthy, it returns the second operand — the result is only a strict boolean if both operands were booleans.
Why doesn't 3>1 and 2 evaluate to the literal value True?
Because 3>1 is True (truthy), so 'and' returns the second operand as-is, which is the integer 2, not the boolean True. The expression is truthy, not literally True.