Let us Suppose, I have created 3 lists and I want to create a dictionary for it. e.g.
a= [\'A\', \'B\', \'C\', \'D\']
b =[1, 2, 3, 4]
c = [9, 8, 7, 6]
You can try this:
a= ['A', 'B', 'C', 'D']
b =[1, 2, 3, 4]
c = [9, 8, 7, 6]
new_data = dict([[a, dict([map(str, i)])] for a, i in zip(a, zip(b, c))])
Output:
{'A': {'1': '9'}, 'C': {'3': '7'}, 'B': {'2': '8'}, 'D': {'4': '6'}}
Or
new_data = dict(zip(a, map(lambda x:dict([x]), zip(map(str, b), map(str, c)))))