Przełączanie klawiszy i wartości w słowniku w Pythonie [duplikat]
my_dict = {2:3, 5:6, 8:9}
new_dict = {}
for k, v in my_dict.items():
new_dict[v] = k
Gorgeous Gerbil
my_dict = {2:3, 5:6, 8:9}
new_dict = {}
for k, v in my_dict.items():
new_dict[v] = k
dict = {value:key for key, value in dict.items()}