Source Code:
(back to article)
original_dict = {'a': 1, 'b': 2, 'c': 3} inverted_dict = dict(map(reversed, original_dict.items())) print(inverted_dict) # Output: {1: 'a', 2: 'b', 3: 'c'}
Result:
Report an issue