How do I exchange keys with values in a dictionary?
How do I exchange keys with values in a dictionary? Question: I receive a dictionary as input, and would like to to return a dictionary whose keys will be the input’s values and whose value will be the corresponding input keys. Values are unique. For example, say my input is: a = dict() a[‘one’]=1 a[‘two’]=2 …