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

For an ordinary function with no yield, which statement combines the effect of return with reaching the end of the body without return?

  1. Return pauses the call; omission raises an error.
  2. Return ends the program; omission returns zero.
  3. Return saves a local; omission returns the final local.
  4. Return ends the call; omission produces None.Ճիշտ պատասխան

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

An executed return ends the active call and supplies its result, while falling off the body supplies None. Python does not infer a result from the final local variable, and omission alone is not an error.

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

Սկսել վարժանքը
Հարց 76: For an ordinary function with no yield, which statement… · Python Fundamentals · Questena