def flatten(l):
    r = []
for x in l:
    if isinstance(x, list):
        r.extend(flatten(x))
else:
    r.append(x)
return r
What's the most efficient way to zip two nested list to a single level dictionary