ProgrammingHardCAT · MBA placement

What is printed?

What is printed?
print(1 < 2 < 3 > 2 == 2, 1 < 3 < 2, (1 < 3) < 2)
  1. A. True False False
  2. B. False False True
  3. C. True False True
  4. D. True True True

Correct answer: C. True False True

Comparisons chain, so 1 < 3 < 2 means 1 < 3 and 3 < 2, which is False. (1 < 3) < 2 compares True with 2 and gives True.

More Python Programming questions

Exams that ask this topic