swap values to keys and keys to values code example Example: how to change key to value and versa in python dictionary dict = {value:key for key, value in dict.items()}