Have you ever run into an error when trying to unpacking a list in Python? This video explains a common python errors that happens when unpacking lists, showing how a simple mistake can cause confusing bugs. It also introduces a helpful python f strings debugging trick to make troubleshooting easier, along with general python syntax.
Ever run into this error?
ValueError: too many values to unpack (expected 2)
Or the opposite:
not enough values to unpack
It’s one of Python’s most common beginner mistakes — and it happens when you try to unpack lists or tuples without matching the number of variables exactly.
In this video, we’ll break down:
Why Python expects a perfect one-to-one match when unpacking
What happens when you have too many or too few values
How to fix it using starred unpacking (*rest)
A handy slicing trick to safely grab what you need
If this bugged you before, now you’ll know exactly how to fix it.
Also check out my video on mutable default arguments — another sneaky Python gotcha that trips up even experienced developers.
On this page of the site you can watch the video online Can You Spot This Python Trap Before It Breaks Your Code? with a duration of hours minute second in good quality, which was uploaded by the user Begin Secure 04 August 2025, share the link with friends and acquaintances, this video has already been watched 298 times on youtube and it was liked by 13 viewers. Enjoy your viewing!