ProgrammingModerateTCS CodeVita · Infosys HackWithInfy

What is printed?

What is printed?
print(all([]), any([]), all(x > 0 for x in [1, 0]))
  1. A. True True False
  2. B. True False True
  3. C. True False False
  4. D. False False False

Correct answer: C. True False False

all of an empty iterable is True and any of it is False. all fails on the 0 in the list, so it is False.

More Python Programming questions

Exams that ask this topic