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

Classify direct dictionary iteration for data = dict(b=2, a=1) and for key in data. Which statements are true? Select all that apply.

  1. The loop yields the keys.Ճիշտ պատասխան
  2. The loop yields 2 and then 1.
  3. The key b is visited before a.Ճիշտ պատասխան
  4. The keys are sorted before iteration.

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

Direct iteration supplies the dictionary's keys, and their traversal follows insertion order, so b precedes a here. Values require an explicit values view, while key-value pairs require an items view; neither is produced by this loop header.

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

Սկսել վարժանքը
Հարց 69: Classify direct dictionary iteration for data = dict(b=2,… · Python Fundamentals · Questena