ProgrammingModerateProduct-company MCQ pattern

What is printed?

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

Correct answer: D. False True False

any([]) is False because there is no truthy element. all([]) is True because there is no falsy element (vacuous truth). all([[]]) checks one element, the empty list, which is falsy, so it is False.

More Python Programming questions

Exams that ask this topic