ProgrammingModerateGATE CS · Product-company placement

What is printed?

What is printed?
x = None
print(x is None, x == None, bool(None), type(None).__name__, None is not False)
  1. A. True True False None True
  2. B. True True False NoneType True
  3. C. True False False NoneType True
  4. D. True True True NoneType False

Correct answer: B. True True False NoneType True

None is the single instance of NoneType; it is falsy but not equal to or identical with False, so `None is not False` is True.

More Python Programming questions

Exams that ask this topic