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

In for key, value in items, what must be true of every visited item for the two-name loop target to unpack successfully?

  1. Every item may have any number of values.
  2. Every item must supply exactly two values.Ճիշտ պատասխան
  3. Items must alternate between key and value.
  4. Only dictionary keys may be visited.

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

Each visited item must provide exactly two values, one for key and one for value. The names do not take alternating iterations, and an item with the wrong number of values cannot be unpacked into this target shape.

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

Սկսել վարժանքը
Հարց 70: In for key, value in items, what must be true of every… · Python Fundamentals · Questena