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 leave it out.
The output for question should look something like this
Do you want to add a state and capital? YesNo
Yes
What is the state? Maine
What is the capital? Augusta
Do you want to add a state and capital? YesNo
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
