This question has been flagged
1 Reply
6898 Views

how to get this error solved?

Avatar
Discard

...by providing more than 1 value maybe?

Can you post code here ?

Best Answer

During a multiple value assignment, the ValueError: need more than 2 values to unpack occurs when either you have fewer objects to assign than variables, or you have more variables than objects. This error caused by the mismatch between the number of values returned and the number of variables in the assignment statement. This error happened mostly in the case of using python split function.  Verify the assignment variables. If the number of assignment variables is greater than the total number of variables, delete the excess variable from the assignment operator. The number of objects returned, as well as the number of variables available are the same. This will resolve the value error.

http://net-informations.com/python/file/split.htm

Avatar
Discard