środa, 2 marca 2011

Dictionary iteration - ValueError: too many values to unpack

If you get the following error trying to iterate on a dictionary:
 
ValueError: too many values to unpack
 
you have forgotten add iteritems() method:
 
for k,v in dict.iteritems():
    print k, v

Brak komentarzy:

Prześlij komentarz