Question: (With Python)Create a dictionary named capitols1 and populate it with these key value pairs: Alabama:Montgomery Alaska:Juneau Arizona:Phoenix Arkansas:Little Rock California:Sacramento Create a dictionary named capitols2

  1. (With Python)Create a dictionary named capitols1 and populate it with these key value pairs:
  2. Alabama:Montgomery Alaska:Juneau Arizona:Phoenix Arkansas:Little Rock California:Sacramento
  3. Create a dictionary named capitols2 and populate it with these key value pairs: California:Sac. Colorado:Denver Connecticut:Hartford Be sure that the California capitol is Sac. and not Sacramento.
  4. Using the dictionary update() method, update capitols1 with capitols2.
  5. Print the sorted capitols (values). Note the updated value of California's capitol.

Results:

Sorted state capitols: ['Denver', 'Hartford', 'Juneau', 'Little Rock', 'Phoenix', 'Sac.']

left side is state and right side is capital of the state

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!