Question: PYTHON PROGRAM Not too sure how to go about writting this program please help!! The input file looks as follows: 1:Qatar:98900 2:Liechtenstein:89400 3:Luxembourg:80600 4:Bermuda:69900 5:Singapore:59700

PYTHON PROGRAM

Not too sure how to go about writting this program please help!!

The input file looks as follows:

1:Qatar:98900 2:Liechtenstein:89400 3:Luxembourg:80600 4:Bermuda:69900 5:Singapore:59700 6:Jersey:57000 ...

and so on all the way to #228.

This is what I need to learn to do:

For this exercise, you will write a program that makes use of two dictionaries. The program should read the data in rawdata.txt into a dictionary whose keys are country names and whose values are per capita incomes. Also create another dictionary whose keys are letters A Z and whose values are sets of country names. Convert the country names to all uppercase for both dictionaries. Your program should prompt the user to enter an initial or a country names and then print the corresponding values.

If the user enters a string with only one letter (like A), the program should print all the countries that begin with that letter, If the user enters a string that contains more than one letter, print the corresponding value for that country if it exists or print Does not exist if invalid. Stop when the user enters quit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!