IN PYTHON:
Write a program to study countries and their capitals. Theprogram will store country:capital information and allow the userto quiz themselves.
These two functions are required for this assignment.You may add other functions that you deem appropriate:
- menu()Â Â This function,which displays all the user options to the screen, prompts the userfor their choice and returns their choice. This function willverify user input and ALWAYS return a valid choice.
- addCapital(dict) This functionaccepts a dictionary as a parameter. This dictionary contains storecountry:capital pairs.
THE PROGRAM MUST:
- Add a country and it’s capital to the dictionary. TheaddCapital function is to be called to complete this task.
- The user can enter a country, and if that country is in thedictionary, it’s capital is printed, otherwise, an error message isprinted.
- Print out the number of countries currently represented in thedictionary.
- Print out all the countries which are currently represented inthe dictionary.
- Print out all of the countries and their capitals currentlystored. If there are no capitals currently stored in thedictionary, a message is printed
- Exit the program