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
Which part of project management involves determining the overall work? Breakdown Incomes Scope Time
Oliga [24]

Answer:

Incomes

Explanation:

Project management has to do with the process of achieving a set goal with the help of a team within a specified time. Most times, the main problem that comes with project management is completing the project within the available constraints.

No project can start up without funds, which in this case is called income and this is the part of the project that determines the overall work.

6 0
2 years ago
Which rules should be remembered when creating formulas using nested functions? Check all that apply.
White raven [17]

Answer:

Use an equal sign at the beginning of the formula (A)

Use open and close parenthesis for each set of nested functions (B)

Functions should be in CAPS

Separate functions with commas

Explanation:

5 0
3 years ago
Read 2 more answers
Match the definition with the corresponding word
Oksana_A [137]

Answer:

Ram is your memory

that's all i know

4 0
3 years ago
Read 2 more answers
Consider the following code:
Phoenix [80]

Answer:

customers += newCustomer;

Explanation:

The operator += expands into + and assignment. The assignment is not overloaded so the required code is

customers += newCustomer;

This expands into

customers = customers + newCustomer;

The overloaded + operator is called for the right expression. This returns a `CustomerList`, which is then assigned through the = operator to `customers`.

3 0
2 years ago
What were black codes?
Lyrx [107]
<span>The Union victory in the Civil War may have given some 4 million slaves their freedom, but African Americans faced a new onslaught of obstacles and injustices during the Reconstruction era (1865-1877). By late 1865, when the 13th Amendment officially outlawed the institution of slavery, the question of freed blacks’ status in the postwar South was still very much unresolved. Under the lenient Reconstruction policies of President Andrew Johnson, white southerners reestablished civil authority in the former Confederate states in 1865 and 1866. They enacted a series of restrictive laws known as “black codes,” which were designed to restrict freed blacks’ activity and ensure their availability as a labor force now that slavery had been abolished. For instance, many states required blacks to sign yearly labor contracts; if they refused, they risked being arrested as vagrants and fined or forced into unpaid labor. Northern outrage over the black codes helped undermine support for Johnson’s policies, and by late 1866 control over Reconstruction had shifted to the more radical wing of the Republican Party in Congress.</span>
8 0
2 years ago
Read 2 more answers
Other questions:
  • During the processing stage what does the computer do
    12·1 answer
  • Write a program that will take an integer and add up each of the number’s digits, count the number of digits in the number, and
    13·2 answers
  • A programmer wrote the code segment below to display the average of all the elements in a list called numbers. There is always a
    8·1 answer
  • IT professionals recognize that successful systems must be user-oriented, and users need to be involved, formally or informally,
    11·1 answer
  • How can you specify a page has the highest priority?
    7·1 answer
  • What type of ransomware was developed to block the user from accessing the computer and encrypts all the files on the user's dev
    5·2 answers
  • What are digital forensic techniques? A. Identifying, extracting, and evaluating evidence obtained from digital media such as co
    11·1 answer
  • State three advantages of using a printer​
    15·1 answer
  • What's the best item in the binding of isaac?
    13·1 answer
  • Which of the following is not a method for opening Word software?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!