Here's the solution:
def invert(d):
return {v: k for k, v in d.items()}
original = {"a": 1, "b": 2, "c": 3}
inverted = invert(original)
print(inverted) # {1: "a", 2: "b", 3: "c"}
Loop through items, but put value as key and key as value.
Warning: if two keys have the same value, one will be lost. The last one wins.