ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy

What is printed?

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

Correct answer: A. True False False False

False equals 0 because bool is a subclass of int, but an empty string or list is not equal to False, even though it is falsy. None is not equal to False.

More Python Programming questions

Exams that ask this topic