1#initialize lists
2
3key_list = ['red', 'green', 'blue']
4value_list = [1, 2, 3]
5
6#convert lists
7
8my_dict = {}
9for key in key_list:
10 for value in value_list:
11 my_dict[key] = value
12 value_list.remove(value)
13 break
14print(my_dict)
15
1>>> result = {}
2>>> for d in L:
3... result.update(d)
4...
5>>> result
6{'a':1,'c':1,'b':2,'d':2}
1>>> from collections import ChainMap
2>>> a = [{'a':1},{'b':2},{'c':1},{'d':2}]
3>>> dict(ChainMap(*a))
4{'b': 2, 'c': 1, 'a': 1, 'd': 2}
5