ProgrammingHardProduct-company MCQ pattern

What is printed?

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

Correct answer: A. True True False

Comparisons chain: 1 < 2 > 1.5 means (1 < 2) and (2 > 1.5), which is True. 3 > 2 == 2 means (3 > 2) and (2 == 2), which is True. With brackets, (3 > 2) == 2 compares True with 2, i.e. 1 == 2, which is False.

More Python Programming questions

Exams that ask this topic