Question: Please typy in PYTHON!!! Thank you! 4. Given a dictionary d, create a new dictionary that reverses the keys and values of d. Thus, the
Please typy in PYTHON!!! Thank you!
4. Given a dictionary d, create a new dictionary that reverses the keys and values of d. Thus, the keys of d become the values of the new dictionary and the values of d become the keys of the new dictionary. If there is a common value for several keys in d then only the last key becomes a value in the new dictionary. Perform the following test case: when d is {1 : 7,2 : 5, 3 : 7,4 : 16,5 : 25, 6 : 5,9 : 7} your code should produce the dictionary {7:9, 5:6, 16:4, 25:5}. (0.5%]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
