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

Which statement correctly describes len(list(zip([1, 2, 3], ["a"]))) under the default zip behavior?

  1. It evaluates to 3.
  2. It evaluates to 0.
  3. It raises TypeError because the lengths differ.
  4. It evaluates to 1.Ճիշտ պատասխան

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

Zip can form only one pair before the shorter input is exhausted, so the resulting list has one item. Default zip neither pads with None nor rejects inputs merely because their lengths differ.

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

Սկսել վարժանքը
Հարց 68: Which statement correctly describes len(list(zip([1, 2, 3],… · Python Fundamentals · Questena