33.1k views
4 votes
In python please.

Given a variable, state_capitals, that refers to a dictionary that maps U.S. states to their capitals, and another dictionary, provincial_capitals, that maps Canadian provinces to their capitals. Associate a dictionary that maps states or provinces to their respective capitals with a variable, regional_capitals.

1 Answer

1 vote

There is a variable, state_capitals, that refers to a dictionary that maps U.S. states to their capitals, and another dictionary, provincial_capitals, that maps Canadian provinces to their capitals. Associate a dictionary that maps states or provinces to their respective capitals with a variable, regional_capitals.

Step-by-step explanation:

The below code is done in python.

{provincial_capitals.keys} + (state_capitals.keys) == regional_capitals

regional_capitals = {}

regional_capitals.update(state_capitals)

regional_capitals.update(provincial_capitals)

User SamB
by
6.5k points