Ask Question
12 December, 21:26

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).

+3
Answers (1)
  1. 12 December, 21:36
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers