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
- (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 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.
- Using the dictionary update() method, update capitols1 with capitols2.
- 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
