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

After for count in [4, 7]: pass completes normally, which statement describes count?

  1. It returns to a prior value of 4.
  2. It becomes None.
  3. It remains bound to 7.Ճիշտ պատասխան
  4. It is deleted, so reading it raises NameError.

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

The loop target remains bound after a nonempty for loop, and the last assignment to count used the final item, 7. Python does not automatically delete the target or restore an older binding when the loop ends.

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

Սկսել վարժանքը
Հարց 71: After for count in [4, 7]: pass completes normally, which… · Python Fundamentals · Questena