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
Artists who draw images on a computer often use a stylus in conjunction with special _________ tablets, which offer extra-sensit
hodyreva [135]

Answer:

Graphics is the correct answer to the following question.

Explanation:

The following answer is true because Graphic tablet is the device in which a person can draw graphics, images or they can also draw by their hands with use of digital pen which is use for drawing as they draw images on the paper. we can also say the graphic tablet is used for the digital art.

So, That's why the following answer is correct.

6 0
3 years ago
What kind is a utility file that shrinks the size of a file
Elena-2011 [213]

Answer:

<u><em>Moxa image resize utility</em></u>

Explanation:

Hope this helped! :)

7 0
3 years ago
What is the smartest person ever
Murljashka [212]

Answer: You!

Explanation: :D

7 0
3 years ago
Read 2 more answers
A picture of kitchen sink draining system​
ale4655 [162]

Answer: So do you need a picture of that or what do you need exactly i would love to help!!

5 0
3 years ago
Read 2 more answers
Darren built a tower out of 23 toy blocks. each block has a mass of 7grams. what is the mass of the whole tower?​
KIM [24]

Answer:

23 x 7 = 161

161 grams

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is an extrinsic value? A. something that is valuable in and of itself B. something that is valuable because it leads to ano
    12·1 answer
  • Kellyn needs to move Slide 8 of his presentation up so that it becomes Slide 6. What best describes how he can do this using the
    13·1 answer
  • Give an example of an input device, an output device, a storage device, and a networking device.
    10·1 answer
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • When evaluating mining results, data mining and evaluating becomes
    6·1 answer
  • Is downloading like installing?
    13·1 answer
  • You should always assign the Needs Met rating before assigning the Page Quality rating, T or F ?
    6·2 answers
  • Choose all stages of the information processing cycle.
    12·2 answers
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • I will give brainliest to the best answer. what is a good screen recorder
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!