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]
3 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]3 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
Given four inputs: a, b, c & d, where (a, b) represents a 2-bit unsigned binary number X; and (c, d) represents a 2-bit unsi
Amiraneli [1.4K]

Answer:

z = a.c' + a.b.d' + b.c'.d'

Explanation:

The truth table for this question is provided in the attachment to this question.

N.B - a' = not a!

The rows with output of 1 come from the following relations: 01 > 00, 10 > 00, 10 > 01, 11 > 00, 11 > 01, 11 > 10

This means that the Boolean expression is a sum of all the rows with output of 1.

z = a'bc'd' + ab'c'd' + ab'c'd + abc'd' + abc'd + abcd'

On simplification,

z = bc'd' + ab'c' + ac'd' + ac'd + abc' + abd'

z = ac' + abd' + bc'd'

Hope this helps!

6 0
4 years ago
Can anyone build my blox burg castel.
lorasvet [3.4K]
No thanks maybe next time tho
6 0
3 years ago
Read 2 more answers
For homework, we were given this photo and to figure out what it is. It is up close and labelled “ too close to tell” but I have
dalvyx [7]
I honestly have no idea on what this is... but im guessing its some sort of tool or food in somebodys mouth... probably isn't but oh well..
7 0
3 years ago
At a local marketing firm, Steve is the lead Web developer and is responsible for working with customers on their Web designs, d
attashe74 [19]

Answer:

All of the above.

Explanation:

Understanding that he must create a unique domain name for each client

Being able to work with HTML

Understanding of the World Wide Web and how hyperlinks work

All of these would be a critical skill Steve must have to be able to perform his job.

6 0
4 years ago
Mike needs to export some animation videos from his smartphone to an online platform. Which common file format can he use for th
Anastasy [175]
The answer would be b
8 0
3 years ago
Other questions:
  • Nathan, a civil engineer in a construction company, is one of the best performers in the organization. He is assigned challengin
    9·1 answer
  • 1. Perform the following Binary Additions 101101 + 10100 *
    13·2 answers
  • Every time you are asked to work with others, you are being asked to:
    6·2 answers
  • Why would a person who handles electronic components wear a grounded wrist strap
    13·1 answer
  • Given the integer variables x, y, and z, write a fragment of code that assigns the smallest of x, y, and z to another integer va
    7·1 answer
  • What is the difference between C and C++. If I know C, will it be hard to lean C++?
    15·1 answer
  • If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
    5·1 answer
  • All NATE specialties are offered at two levels, A. journeyman and master. B. installation and service. C. apprentice and journey
    7·1 answer
  • The meaning of belt drives
    10·1 answer
  • oftware that is free and whose code can be accessed and potentially modified by anyone is referred to as _____. shared source fi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!