Question: PYTHON Task 3 Create a dictionary of Countries that begin with any 5 letter of the alphabet Each letter should have a minimum of 3
PYTHON
Task 3 Create a dictionary of Countries that begin with any 5 letter of the alphabet Each letter should have a minimum of 3 countries E.G. C => Canada, Cameroon, Cambodia D => Djibouti, Dominica, Dominican Republic Create a program that displays a menu which gives the user the opportunity to view, add, or delete a country from a dictionary of countries. It will also allow the user to shuffle the order of both the country letters and country names order of each letter. Lastly, the menu should also, give the user the opportunity to exit the program. Create a function for this named 'display_menu'. It will explain to the user the list of possible actions (outlined below) Create a function named 'view'. It will evaluate the argument passed to it. If it is one character and exists in the dictionary of countries, it will display all the countries starting with that letter. If not, it will display all the countries Create a function named 'add'. It will take one argument and ensure the argument is at least 4 characters. It will then put the country into its appropriate place. It will return a boolean value of whether or not the addition was successful Create a function named 'delete'. It will take one argument and search for the country. If it is found, it will remove it. It will return a boolean value of whether or not the deletion was successful Create a function named 'shuffle'. It will re-order both the country letters order and the country names order Create a function named 'start'. It will call the display_menu method in an indeterministic loop that will stop once the user types either 'stop' or 'quit' Create a function named 'main'. It will determine if the current module is the main module, if it is, it will call the start method
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
