1answer.
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
nikklg [1K]
2 years ago
9

Taylor and Rory are hosting a party. They sent out invitations, and each one collected responses into dictionaries, with names o

f their friends and how many guests each friend is bringing. Each dictionary is a partial list, but Rory's list has more current information about the number of guests. Fill in the blanks to combine both dictionaries into one, with each friend listed only once, and the number of guests from Rory's dictionary taking precedence, if a name is included in both dictionaries. Then print the resulting dictionary.
Computers and Technology
1 answer:
disa [49]2 years ago
7 0

Answer:

Following are the code to this question:

def combine_guest(guest1, guest2):#defining a method combine_guest that accepts two dictionary

   guest2.update (guest1)#use dictionary guest2 that use update method to update guest2 dictionary

   return guest2#return guest2 dictionary values

Rory_guest= { "Ada":2, "Ben":3, "Dav":1, "Jo":3, "Charry":2, "Terry":1, "bob":4}#defining a dictionary and add value

Taylor_guest = { "Dav":4, "Nan":1, "bobert":2, "Ada":1, "Samantha":3, "Chr":5}#defining a dictionary and add value

print(combine_guest(Rory_guest,Taylor_guest))#calling the combine_guest method

Output:

{'Nan': 1, 'Samantha': 3, 'Ada': 2, 'bob': 4, 'Terry': 1, 'Jo': 3, 'Ben': 3, 'Dav': 1, 'Charry': 2, 'bobert': 2, 'Chr': 5}

Explanation:

In the code a method, "combine_guest" is defined, that accepts two dictionaries "guest1, guest2" inside the method, in which the "guest2" dictionary uses the update method to combine the value of the guest1 dictionary and use a return keyword to return guest2 values.

In the next step, two dictionaries are declared, that holds some values and use a print method to call the "combine_guest" method and prints its return values.  

You might be interested in
What does getfenv() do?
mariarad [96]

Answer: getfenv() is a type of function. Particually a envirotment function. for a lua coding.

Explanation: What this does it goes thourgh  line of code in a particular order.

This means. getfenv is used to get the current environment of a function. It returns a table of all the things that function has access to. You can also set the environment of a function to another environment.

Forgot to include examples of where this could be used. Although not very common uses, there are some. In the past Script Builders used getfenv to get the environment of a script, and setfenv to set the environment of a created script’s environment to a fake environment, so they couldn’t affect the real one. They could also inject custom global functions.

Not entirely sure if this uses getfenv or setfenv, but the use in Crazyman32’s AeroGameFramework is making the environment of each module have access to other modules without having to require them, and having access to remotes without having to directly reference them.

5 0
2 years ago
Read 2 more answers
What qualities in an employee are highly desired by employers?
slava [35]
Flexibility and open-mindedness
being quick to adapt to technology changes
having a positive attitude
taking initiative to solve problems
5 0
3 years ago
Read 2 more answers
The proxy statement issued by a corporation is a requirement of: a. The Securities & Exchange Commission (SEC) b. The Financ
8090 [49]

Answer:

The answer is "Option a".

Explanation:

A proxy statement is a file, that provides security and exchange in data commission, that is a powerful tool for holders, as it tells employees, that together with the instructions to do, and other choices, which could be listed as follows are wrong:

  • In option b, It is used in accounting guidelines, that's why it is wrong.
  • In option c, It requires, that's why it is incorrect.
  • In option d, It is wrong because it doesn't committee.
8 0
3 years ago
Consider this query:
vlabodo [156]

Answer:

There is a table in the database named Teacher having columns Email, Expiry Month etc. this query is selecting the email address from the table Teachers on the basis of expiry month that is February.\  

Explanation:

4 0
2 years ago
The Monte Carlo (MC) Method (Monte Carlo Simulation) was first published in 1949 by Nicholas Metropolis and Stanislaw Ulam in th
Eddi Din [679]

Answer:

can you give more detail

Explanation:

3 0
2 years ago
Other questions:
  • What is the Multiplier if the change in RGDP is $525,000,000 and initial spending is $100,000?
    12·1 answer
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Which fingers should you use to type the reach keys?
    12·1 answer
  • Which statement accurately describes DTP programs?
    11·1 answer
  • Whats the answer to this question?
    7·1 answer
  • Tree diagrams are useful for
    12·1 answer
  • What are the advantages of using the internet as theinfrastructure for electronic commerce and electronicbusiness?
    6·1 answer
  • (Display four patterns using loops) Ask the user to enter an integer to
    8·1 answer
  • What is the effect of this program?
    5·1 answer
  • Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!