ProgrammingModerateTCS NQT · Wipro pattern

What is printed?

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

Correct answer: A. True True 2

The chain 3 > 2 > 1 means both comparisons hold. Booleans add as integers, so True + True is 2.

More Python Programming questions

Exams that ask this topic