Question: Familiarize yourself with creating and processing dictionary and set data structures in Python Familiarize yourself with their operations Program: Write a python program that do
Familiarize yourself with creating and processing dictionary and set data structures in Python
Familiarize yourself with their operations
Program:
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 st 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
