practicepython.in
python exercises
171 exercises

Daily #30 · 28 October 2026

Uneven pairs Easy

What does this print?

print(list(zip(["a", "b", "c"], [1, 2])))
  1. A[('a', 'b', 'c'), (1, 2)]
  2. B[('a', 1), ('b', 2), ('c', None)]
  3. Craises ValueError
  4. D[('a', 1), ('b', 2)]
Show the answer

D: [('a', 1), ('b', 2)]

Why: zip stops at the shortest input and says nothing about the leftover c. zip(..., strict=True) raises instead, which is what you usually want when the lengths should match.

Play today’s puzzle →