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