Run
my_dict = { 'foo':12, 'bar':14 } swapped_dict = {} for key, value in my_dict.items(): swapped_dict[value] = key print(swapped_dict)
Output