Question: Using Python Question 23 7 pts Write a function called reverselookup that takes a list as a parameter. In the function, create an empty dictionary

 Using Python Question 23 7 pts Write a function called reverselookup

Using Python

Question 23 7 pts Write a function called reverselookup that takes a list as a parameter. In the function, create an empty dictionary and loop over the list. Loop over the list so that you have access to the indices in the list. If the value from the list is not a key in the dictionary, add the value from the list as a key to the dictionary. Use the current index as the value. (So, if the value is "a" and it is at index 20, the dictionary would end up with a key of "a" and a value of 20.) Return the dictionary after the loop is over. Question 23 7 pts Write a function called reverselookup that takes a list as a parameter. In the function, create an empty dictionary and loop over the list. Loop over the list so that you have access to the indices in the list. If the value from the list is not a key in the dictionary, add the value from the list as a key to the dictionary. Use the current index as the value. (So, if the value is "a" and it is at index 20, the dictionary would end up with a key of "a" and a value of 20.) Return the dictionary after the loop is over

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!