inverting dictionary with dict comprehension code example Example: invert dictionary python inv_map = {v: k for k, v in my_map.items()}