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