Ask Question
16 September, 19:37

The inverse of a map is a new map where the values of the original map become the keys of the new map and the keys become the values. For example, given the map {1:2, 3:4}, the inverse is the map {2:1, 4:3}. Given the map, d, create the inverse of d. Associate the new map with the variable inverse. You may assume that there are no duplicate values in d (that is no two keys in d map to the same value).

+2
Answers (1)
  1. 16 September, 20:48
    0
    The inverse of d would be:

    inverse = { }

    for key, value in d. items ():

    inverse [value] = key|
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The inverse of a map is a new map where the values of the original map become the keys of the new map and the keys become the values. For ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers