QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 73

Immediately after Python executes a plain def statement with no decorators, but before the function is called, what has happened?

  1. A function object has been created and named.Ճիշտ պատասխան
  2. Only text has been recorded; no object exists yet.
  3. The body has run once automatically.
  4. The name will be bound by the first call.

Բացատրություն

Executing def creates a function object and binds the declared name to it at that moment. The body waits for a call, so claiming that def immediately runs the body confuses definition with invocation.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 73: Immediately after Python executes a plain def statement… · Python Fundamentals · Questena