Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions