ProgrammingHardTCS NQT · Wipro pattern

What is printed?

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

Correct answer: C. True False False False

all of an empty input is True and any of an empty input is False. Both arguments of all([0, 1]) must be true, and any([0, '']) finds no truthy value.

More Python Programming questions

Exams that ask this topic