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

After list = [] executes in a scope, what does the name list resolve to in that scope?

  1. The built-in type, because built-ins cannot be rebound
  2. Both objects at once, chosen by call context
  3. The newly bound empty list objectПравильный ответ
  4. No object, because the assignment is ignored

Объяснение

The assignment places a user binding named list in the current scope, so normal lookup finds that empty list object before the built-in type. Built-in names are ordinary names that can be shadowed; they do not automatically take precedence.

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

Начать тренировку
Вопрос 119: After list = [] executes in a scope, what does the name… · Python Fundamentals · Questena