answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vlad [161]
2 years ago
11

Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province

s or states to their respective capitals, create a new dictionary that combines these three dictionaries, and associate it with a variable, nafta_capitals.
Python 3
Computers and Technology
1 answer:
Nookie1986 [14]2 years ago
4 0

Answer:

The Python code to combine the three dictionaries are is given as follows:

  1. canadian_capital = {
  2.    cash: "SOME VALUES",
  3.    assets: "SOME VALUES"
  4. }
  5. mexican_capital = {
  6.    cash: "SOME VALUES",
  7.    assets: "SOME VALUES"
  8. }
  9. us_capital = {
  10.    cash: "SOME VALUES",
  11.    assets: "SOME VALUES"
  12. }
  13. nafta_capital = {
  14.    canadian: canadian_capital,
  15.    mexican : mexican_capital,
  16.    us: us_capital
  17. }

Explanation:

<u>Line 1 - 14 :</u>

Create three Python dictionaries and name them as <em>canadian_capitals, mexican_capital </em>and<em> us_capitals</em>. Please note a Python dictionaries should be enclosed in curly braces { }.  

We just define two samples of relevant keys (<em>cash </em>and <em>asset</em>) in each of the dictionaries. Python dictionary can map a key to a value.

Since we are not given any capital values from the question,  a dummy string "<em>SOME VALUES</em>" is tentatively set as the value for each of the keys.

In practice, we should replace those dummy strings with the real values of capital. The values can be a number, a string, a list and even a nested dictionary.

<u>Line 16 - 20 : </u>

Create one more Python dictionary and name it as <em>nafta_capital</em>.

Since our aim is to combine the three previous dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em>) and associate it with <em>nafta_capital</em>, we can define three different keys (<em>canadian, mexican </em>and <em>us</em>) in our dictionary nafta_capital.

As mentioned, a value associated with a key can be a nested dictionary. Hence, we just map <em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> as the value of the keys (<em>canadian, mexican </em>and<em> us</em>) in dictionary<em> nafta_capital,</em> respectively,

By doing so, we have managed to combine three target dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> ) into a single dictionary, <em>nafta_capital</em>.

You might be interested in
A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
Butoxors [25]

Apply encryption to VM files the following steps should be taken to secure the VMs so no user can copy or delete another user's VM files

f. Apply encryption to VM files.

b. secure the VM files with permissions

<u>Explanation:</u>

Installing anti-malware is a must on each VM OS OR Host OS to protect both servers and hosted workstations.

Scheduling update OS patches and anti-malware and scanning server or host operation are also must.

Securing VM files as best practices better to encrypt and decrypt is the best method or best practices.

Even protected VM files sometimes can be hacked and damaged the VM files.

VM is a virtual machine technology is used in windows 10. Before login decrypts the VM and connects to virtual machines. On disconnected encrypted is safer.

5 0
2 years ago
Which of the following word pairs correctly completes the sentence below?
Julli [10]

B. negative, positive

4 0
2 years ago
Read 2 more answers
Which component of a computer is its input device and what role does it play in a document?
kogti [31]
The keyboard is used to input information. (Entering data)
5 0
2 years ago
Read 2 more answers
Convert the following numbers to binary numbers: 5 , 6 , 7 , 8 , 9 .​
Anon25 [30]

Answer:

log 5,6,7,8,9 is the binary number according to the computer

7 0
2 years ago
Read 2 more answers
Which of the following would be a considered a want rather than a need for most people?
UNO [17]

c. would be the best answer.


3 0
2 years ago
Other questions:
  • A domain's ____ settings must be configured correctly so that the mail transfer agent (mta) can establish a connection with a re
    15·1 answer
  • Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
    11·1 answer
  • Enter a formula in cell B10 to return a value of 35000 if the Net Profit After Tax (cell B9) is greater than or equal to 470000
    15·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • 3. Choosing a pre-formatted presentation (that already has a design in the slides) is called choosing a ?
    6·1 answer
  • You are on vacation and want to see where all the restaurants and trendy shops are in relation to your hotel. You remember there
    15·1 answer
  • Assume that we would like to expand the MIPS register file to 128 registers and expand the instruction set to contain four times
    14·1 answer
  • In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where element
    9·1 answer
  • Write a program that gets a list of integers from input, and outputs non-negative integers in ascending order (lowest to highest
    13·2 answers
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!