Dictionnaire inversé Python
inv_map = {v: k for k, v in my_map.items()}
Busy Boar
inv_map = {v: k for k, v in my_map.items()}
d = {'a':1, 'b':2, 'c':3}
inverted_d = {}
for k, v in d.items():
inverted_d[v] = k
orig = { 1:'A', 2:'B', 3:'C' }
new = dict(zip(orig.values(), orig.keys()))
new == {'A': 1, 'B': 2, 'C': 3} #True