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

After import builtins and list = [], classify the next operations. Which statements are true? Select all that apply.

  1. list("ab") raises TypeError.Правильный ответ
  2. list("ab") automatically calls the built-in constructor.
  3. Shadowing permanently removes the built-in from Python.
  4. builtins.list("ab") returns ['a', 'b'].Правильный ответ

Объяснение

The local name now denotes a non-callable list object, so attempting list("ab") raises TypeError rather than falling back automatically. The built-in remains available through the builtins module, whose list constructor returns a character list for the string.

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

Начать тренировку
Вопрос 120: After import builtins and list = [], classify the next… · Python Fundamentals · Questena