QuestenaПрактика, после которой понятно, что повторить
Вопрос 117

Why does x is None distinguish None reliably from other falsy values such as 0 and an empty list?

  1. None is a singleton, so identity singles it out.Правильный ответ
  2. Every falsy value is another spelling of None.
  3. x == False and x is None always mean the same thing.
  4. Identity converts every falsy value to None.

Объяснение

None has a single shared identity, so the test asks specifically whether x refers to that singleton. General falsiness is broader: zero and an empty list are falsy but are different objects and meanings.

Продолжить работу с тестом

Начать тренировку
Вопрос 117: Why does x is None distinguish None reliably from other… · Python Fundamentals · Questena