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
Sara wants to set up her lights to turn on when she arrives home. She has heard that she might be able to do this using IoT. Wha
iren [92.7K]

Sara should be concerned about security when setting up her loT lights.

<h3>What are loT lights?</h3>

loT light are otherwise called parking lot lights are outdoor lights that are placed on poles which are located on parking lots, pathways and driveways.

The loT light are used to provide bright light to the individuals so as to safely perform their various duties.

Therefore, Sara should be concerned about security when setting up her loT lights.

Learn more about security here:

brainly.com/question/25720881

8 0
2 years ago
Read 2 more answers
Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
daser333 [38]

Solution :

Here, we need to perform JOIN operation of the students and registration.

Use NATURAL JOIN operator \Join and so no need to specify Join condition.

Also we need to selection operator tp select only those course whose major in "philosophy".

Finally we projection operator π to project only distinct students name who took at least three courses.

$\pi [\sigma_{\text{student's nam}e} [ \sigma(\text{three courses}) \Join \text{"Philosophy"}]]$

7 0
3 years ago
Most students overestimate their skill level and abilities to take open book tests.
leonid [27]
True...the assumption being that the student believes he/she will be able to locate the answer within the text rapidly, but they underestimate the fact that "application" of the content/question is primarily what the instructor is looking for, and will require critical thinking skills to apply the book content to the the question; not just "find the answer". 
3 0
3 years ago
Read 2 more answers
Writers in our networked world enhance their credibility by
yaroslaw [1]

Answer:

b

Explanation:

5 0
3 years ago
Where in the Formula tab on the ribbon would you find the Use in Formula function?
Leviafan [203]

Answer:

In Function library you would find the use in Formula function

5 0
3 years ago
Read 2 more answers
Other questions:
  • The layout button is located in the ____ group on the home tab?
    14·1 answer
  • Clep allows students to do all of thw following except which?
    11·2 answers
  • Casey, a woodworker, is developing his own website. He plans to use the site as a means of selling his handmade furniture. While
    10·1 answer
  • _____________ describes the abstraction of web-based computers, resources, and services that system developers can utilize to im
    9·1 answer
  • Flash drives, CDs, external disks are all examples of storage (memory) devices.'True or false?
    9·1 answer
  • Help giving points mark BRAINLEST
    5·1 answer
  • Can you give an example of mail merge (letter) pls​​
    6·1 answer
  • How do Computer Scientists use Binary Code?
    14·1 answer
  • Which of the following is not a bus type A. Address bus B. Data bus C. Memory bus D. Control bus ​
    7·2 answers
  • A classic game, Wario Land, has an invincible main character who reacts to the environment in order to solve puzzles. So, for ex
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!