Data Structures & AlgorithmsHardTCS NQT Digital · Python semantics

Problem: What does the following print?

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

Correct answer: C. False True

any of nothing is False and all of nothing is True, following the identity elements of logical or and and.

More Coding Interview Problems questions

Exams that ask this topic