You can use in-built method dict() and zip() to convert two lists into a dictionary in Python as shown in the below example –
1 2 3 4 5 6 |
keys = ['a', 'b', 'c'] values = [1, 2, 3] dictionary = dict(zip(keys, values)) print(dictionary) ## Returns {'a': 1, 'b': 2, 'c': 3} |