Source Code:
(back to article)
keys = ['a', 'b', 'c'] values = [1, 2, 3] my_dict = dict([(keys[i], values[i]) for i in range(len(keys))]) print(my_dict) # {'a': 1, 'b': 2, 'c': 3}
Result:
Report an issue