python - Need more than 1 value to unpack -


i writing following code create dictionary:

for a,b,c in foo:    d=float(a or 0)-float(b or 0)    bar[c]=d    print bar 

this works gives me bar on , over. when try use bar outside loop, following error;

valueerror: need more 1 value unpack 

that error message means trying store 1 value in tuple requires more 1 value.

>>>(x,y,z) = [5] valueerror: need more 1 value unpack 

you should somewhere in code assigning tuple. seems foo list of tuples. maybe trying assign element of foo


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -