Question: Write a python program that do the following: A. Make the user enter countries and their capital: a. You implement a way to stop
Write a python program that do the following: A. Make the user enter countries and their capital: a. You implement a way to stop asking the user B. Create a dictionary: a. Countries are keys i. Handle duplicates keys if the user enter a duplicate key, keep the 1st value b. Capitals are values C. Display the dictionary D. Take all keys from dictionary and convert it to a list a. Reverse the key list b. Display the reversed list E. Takes all values from dictionary and make it into a set a. Display set F. Create a set with these items (Riyadh, Kuwait, Abu Dhabi,Manama, Muscat, Doha) a. Display all the capitals that do not appear in this set
Step by Step Solution
There are 3 Steps involved in it
Given a dictionary of countries and their capitals and a set of capitals the following Python progra... View full answer
Get step-by-step solutions from verified subject matter experts
