I am trying to figure out what the subsequent lines of python code actually do:
if (var1 and var1) in [ctl for key, value in list(uof.items()) for ctl, com in list(cd.items()) if com == 'spain']:
my_var= uof_map[var1 ]
I assume it executes some kind of the following logic:
for key, values in list(uof.items()):
for ctl, com in list(values.items()):
if com == 'spain':
But apparently the results do differ. Can someone please point me into the right direction?
Notes:
uof
is a dictionary of dictionaries
value
is a dictionary