ProgrammingHardTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(all(i < j for i, j in zip([1, 2, 3], [2, 3, 3])))
  1. A. None
  2. B. 0
  3. C. False
  4. D. True

Correct answer: C. False

The pairs are (1, 2), (2, 3) and (3, 3). The last pair fails because 3 < 3 is false, so all returns False.

More Python Programming questions

Exams that ask this topic