0

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

tahesse
  • 1,351
  • 14
  • 30
jalazbe
  • 1,527
  • 1
  • 12
  • 36

0 Answers0