1. Simplest/most straightforward:
d = {"A":1,"B":2,"C":3}
inv = {}
for k in d.keys():
   inv[d[k]] = k
  1. Alternative: use d.items(), iterate over tuples
d = {"A":1,"B":2,"C":3}
inv = {}
for a,b in d.items():
   inv[b] = a
  1. Iterate over tuples, build up a reversed list, pass it to dict()
d = {"A":1,"B":2,"C":3}
invlist = []
for a,b in d.items():
   invlist.append([b,a])
inv = dict(invlist)
  1. Same thing with a list comprehension:
d = {"A":1,"B":2,"C":3}
dict([[b,a] for a,b in d.items()])
  1. Or using zip():
d = {"A":1,"B":2,"C":3}
dict(zip(d.values(),d.keys()))