QuestenaPráctica que te muestra qué repasar después
Pregunta 120

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

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

Explicación

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.

Continúa con este test

Empezar la práctica
Pregunta 120: After import builtins and list = [], classify the next… · Python Fundamentals · Questena