Loop thru the dictionary with tuples

Igor Korot ikorot01 at gmail.com
Sun May 25 08:55:00 EDT 2014


Hi, ALL,
I have a following data structure:

my_dict[(var1,var2,var3)] = None
my_dict[(var4,var5,var6)] = 'abc'

What I'm trying to do is this:

for (key,value) in my_dict:
    #Do some stuff

but I'm getting an error "Too many values to unpack".

What am I doing wrong?

Thank you.



More information about the Python-list mailing list