Advertisements
Advertisements
Question
Which of the following expressions in Python evaluates to True?
Options
2>3 and 2<3
3>1 and 2
3>1 and 3>2
3>1 and 3<2
MCQ
Advertisements
Solution
3>1 and 3>2
Explanation:
The and operator is True only when both comparisons are True. 3>1 is True, and 3>2 is True, so the whole expression is True. Other choices have a False part (or in one case evaluate to a non-boolean truthy value like 2), so they do not evaluate to the boolean True.
shaalaa.com
Is there an error in this question or solution?
