1. Home
  2. Data Science
  3. Python
  4. What is the result of list(zip([1, 2, 3], ['a', 'b']))?

Added 2 Nov 2026

What is the result of list(zip([1, 2, 3], ['a', 'b']))?

  1. [1, 'a', 2, 'b', 3]
  2. An error because the lengths differ
  3. [(1, 'a'), (2, 'b')] Correct answer
  4. [(1, 'a'), (2, 'b'), (3, None)]

Correct answer

C. [(1, 'a'), (2, 'b')]

16 views

MCQSEXAM

Explanation

zip stops at the shortest input. Use itertools.zip_longest to pad missing values, or zip(..., strict=True) in Python 3.10+ to raise an error on unequal lengths.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs