Question: Dictionaries. Create a program that creates a dictionary of the following states and their capitals: Colorado, New Mexico, Wyoming, Montana, Oregon, Washington, Utah, California, Arizona.

Dictionaries. Create a program that creates a dictionary of the
following states and their capitals: Colorado, New Mexico, Wyoming, Montana, Oregon,
Washington, Utah, California, Arizona. You will have to look up the capitals. The user will
input the state and the capital to add to the dictionary. Once all of the states are entered the
program should ask the user for a state name (Query the dictionary) and then print the capital.
If New Mexico gives you problems in question 1- leave it out.
The output for question 1 should look something like this
Do you want to add a state and capital? (Yes/No)
Yes
What is the state? Maine
What is the capital? Augusta
Do you want to add a state and capital? (Yes/No)
No
Please pick a state: Maine
The capital of Maine is: Augusta

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 Accounting Questions!