On 2014-05-25 05:59, Paul Rubin wrote:
> Igor Korot <ikoro...@gmail.com> writes:
> > for (key,value) in my_dict:
> >     #Do some stuff
> >
> > but I'm getting an error "Too many values to unpack".
> 
> Use 
>     for (key,value) in mydict.iteritems(): ...

You can even use

  for ((k1,k2,k3), value) in mydict.iteritems():
    ...

if you need to unpack the key at the same time.

-tkc



Attachment: signature.asc
Description: PGP signature

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to