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