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