practicepython.in
python exercises
171 exercises

Daily #29 · 27 October 2026

The middle Medium

What does this print?

first, *middle, last = [1, 2, 3, 4, 5]
print(middle)
  1. Araises ValueError
  2. B[2, 3, 4]
  3. C(2, 3, 4)
  4. D2
Show the answer

B: [2, 3, 4]

Why: The starred name collects everything the others did not take, and it is always a list, even when you unpack a tuple.

Play today’s puzzle →