ProgrammingHardProduct-company MCQ pattern

What is printed?

What is printed?
print(1 == 1.0 == True, 2 == 2.0 != 3.0)
  1. A. True False
  2. B. True True
  3. C. False True
  4. D. False False

Correct answer: B. True True

Chained comparisons test each adjacent pair. 1 == 1.0 and 1.0 == True both hold, and 2 == 2.0 and 2.0 != 3.0 both hold.

More Python Programming questions

Exams that ask this topic