Answered step by step
Verified Expert Solution
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
- (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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started