ValueError: not enough values to unpack (expected 11, got 1)

The Solution to ValueError: not enough values to unpack (expected 11, got 1) is


For the line

line.split()

What are you splitting on? Looks like a CSV, so try

line.split(',')

Example:

"one,two,three".split()  # returns one element ["one,two,three"]
"one,two,three".split(',')  # returns three elements ["one", "two", "three"]

As @TigerhawkT3 mentions, it would be better to use the CSV module. Incredibly quick and easy method available here.

~ Answered on 2016-01-06 06:56:31


Most Viewed Questions: