Coding tips
ValueError: too many values to unpack (expected 2) in Python: 10 Causes and Fixes, Plus not enough values to unpack (Tested Examples)
Python raises ValueError: too many values to unpack (expected 2) when the right side of an assignment has more items than the names on the left. Here are 10 real causes, from split() and dict loops to enumerate and function returns, with tested output and a fix for each.