#Basics
Swap keys and values of a dictionary
dictionary = {"a": 1, "b": 2, "c": 3}
reversed_dictionary = {j: i for i, j in dictionary.items()}
print(reversed)
Output:
{1: 'a', 2: 'b', 3: 'c'}
Share and Support
@Python_Codes
>>Click here to continue<<