QuestenaPractice that shows what to review next
Question 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 objectCorrect answer
  4. No object, because the assignment is ignored

Explanation

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.

Continue with this test

Start practice
Question 119: After list = [] executes in a scope, what does the name… · Python Fundamentals · Questena