QuestenaPractice that shows what to review next
Question 120

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

  1. list("ab") raises TypeError.Correct answer
  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'].Correct answer

Explanation

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.

Continue with this test

Start practice
Question 120: After import builtins and list = [], classify the next… · Python Fundamentals · Questena