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
Mellissa wants to pursue a career in database administration. Select the requirements needed to achieve this.
adelina 88 [10]
I think its the answer is 4 
8 0
3 years ago
Read 2 more answers
Before your shell forks a new process to call execvp(), it should parse the input string and separate it into a collection of su
kompoz [17]

Answer:

#define LSH_RL_BUFSIZE 1024

char *lsh_read_line(void)

{

int bufsize = LSH_RL_BUFSIZE;

int position = 0;

char buffer = malloc(sizeof(char) bufsize);

int c;

if (!buffer) {

   fprintf(stderr, "lsh: allocation error\n");

   exit(EXIT_FAILURE);

}

while (1) {

   // Read a character

   c = getchar();

   // If we hit EOF, replace it with a null character and return.

   if (c == EOF || c == '\n') {

     buffer[position] = '\0';

     return buffer;

   } else {

     buffer[position] = c;

   }

   position++;

   // If we have exceeded the buffer, reallocate.

   if (position >= bufsize) {

     bufsize += LSH_RL_BUFSIZE;

     buffer = realloc(buffer, bufsize);

     if (!buffer) {

       fprintf(stderr, "lsh: allocation error\n");

       exit(EXIT_FAILURE);

     }

   }

}

}

Explanation:

3 0
3 years ago
In a function header, you must furnish? the name of function all data type of the return value data type(s) of the parameters na
Alja [10]

In a function header, you must furnish the following:

  • The name of the function.
  • The data type of the return value.
  • The data type of the parameters.
  • The names of parameter variables.

<h3>What is a Function header?</h3>

A function header may be defined as a set of instructions that includes the name of the function that conveys to us what type of data it expects to respond to and the type of data it will return back to the calling function or program.

It will significantly mention all sorts of instructions like the compiler, the parameters, return value type, parameters of the variables, etc.

Therefore, the body of the functional header comprises all instructions that should be executed within a specific interval of time.

To learn more about the Function header, refer to the link:

brainly.com/question/12435434

#SPJ4

5 0
1 year ago
You are using a program that can run multiple operating systems and manage hardware
stellarik [79]

Answer:

<u>Hypervisor Type 1</u>

<u>Explanation:</u>

The Hypervisor Type 1 is a program known for its ability to run multiple operating systems and still use and manage the same hardware and storage resources.  

This software does this by means of a technology called Virtual machines (virtualization). So it is most likely possible that one is using Hypervisor Type 1.

3 0
3 years ago
What are short handled screwdrivers used for?
Pani-rosa [81]
I see a set on Amazon, it says they are for tight spaces.
4 0
3 years ago
Other questions:
  • Hola, alguien me puede ayudar¡¡¡¡¡¡¡¡¡¡¡¡
    11·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • Meaning of page break​
    8·1 answer
  • A computer has 9850 processes and 172 of them where suspended while 276 were terminated.,explain why some of the processes where
    15·1 answer
  • "3. 4. Simple number search We will pass you 2 inputs an list of numbers a number, N, to look for Your job is to loop through th
    5·1 answer
  • Employees don't have to comply with PPE requirements if they feel the PPE isn't necessary for the particular task they performed
    14·2 answers
  • In Online Data Extraction data is extracteddirectly from the ------ system itself.o Hosto Destinationo Sourceo Terminal
    15·1 answer
  • Who wants to give free points to me?
    6·2 answers
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and phone needs. Gr
    8·1 answer
  • An electronic tool that allows information to be input processed and output? A, operating system B.motherboard C.cpu D.computer
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!