eg1:
>> >> a,b=(1,2,3)
Traceback (most recent call last):
& & lt; stdin>, line 1,in < module>
ValueError: too many values to unpack (expected 2)
ERROR: a tuple value is 32473; when a tuple variable, the number is not the product
can change a,b,c=(1,2,3) or other variables
eg2:
>> >> Import collections
>> >> s=[(‘y’,1), (‘b’,1), (‘r’),(‘y’,2)]
>> >> d=collections.defaultdict(list)
>> >> for k,v in s:
…obey[k].append(v)
…
Traceback (most recent call last):
& & lt; stdin>, line 1,in < module>
ValueError: too many values to unpack (expected 2)
ERROR: s=[(‘y’,1),(‘b’,1),(‘r’),(‘y’,2)] The number of values in this string (‘r’) is not valid
can change s=[(‘y’,1), (‘b’,1), (‘r’,1), (‘y’,2)] or other values
Similar Posts:
- [Solved] Python TypeError: sequence item 0: expected str instance, int found
- AttributeError: ‘tuple’ object has no attribute ‘extend’
- TypeError: list indices must be integers or slices, not tuple
- Tag code error valueerror: bad input shape()
- Python Exception: TypeError: write() argument must be str, not list
- How to Solve Python TypeError: ‘list’ object is not callable
- Python import random error handling method [Solved]
- Solution of import Cafe error reporting in Python command line
- Python3: list dict set [UNK]unhashable type
- How to Solve celery5.1 Startup Error in Windows