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
Crazy boy [7]
3 years ago
5

Write a Python function merge_dict that takes two dictionaries(d1, d2) as parameters, and returns a modified dictionary(d1) cons

tructed using the following rules. The rules for addition into the new dictionary are as follows: Add key/value pairs from d2 into d1. If a key from d2 already appears in d1: the new value in d1 is the sum of the values If a key appears only in d1 or d2, then the new value in d1 is the original value from the dictionary that contained this key. Finally, return d1
Computers and Technology
1 answer:
OLga [1]3 years ago
7 0

Answer:

# We define the function merg_dict with the two dictionaries d1 and d2 that it #will take.

def merge_dict(d1,d2):

      for key in d2:

               if key in d1:

                   d1[key] = d1[key] + d2[key]

               else:

                   d1[key] = d2[key]  

          return d1

# We define the parameters of the dictionary d1 and d2

d1 = {'a': [1, 2, 3], 'b': [2, 2, 2], 'c': [1,2,3]}

d2 = {'a': [4,4,4], 'c': [3,3,3]}

#Next we call on the function merge_dict

print(merge_dict(d1,d2)

We'll obtain the following as output:

{'a': [1,2,3,4,4,4], 'b': [2,2,2], 'c': [1,2,3,3,3,3]}

You might be interested in
What are MIDI signals?
Valentin [98]
Well it could possibly be two things.

Either it's like a standard protocol for communication between electronic musical instruments and computers.

Or


It's a Musical Interface Digital something or other.
4 0
3 years ago
What will empty the log of Internet sites you have recently viewed
melomori [17]
On google- on the top right of the screen, there is a box with a number on it that will show how many tabs you have up. Click on it and empty the sites.
On your phone- If it's an Iphone, you double click the button on your phone.
6 0
3 years ago
Read 2 more answers
Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
Ilia_Sergeevich [38]

Frequently used filters can be saved as queries for use in analysis, dashboards, reports, tickets, and alerts.

<h3>What are the types of filters in a computer?</h3>

The low-pass filter, high-pass filter, band-pass filter, and notch filter are the four main categories of filters (or the band-reject or band-stop filter).

The following is a list of the three filtration kinds.

Vacuum Filtration: In order to quickly draw fluid through a filter, vacuum filtration uses a vacuum pump.

Centrifugal Filtration: In this technique, the material to be filtered is spun at a very high speed.

You can use the filter tool to identify the crucial elements you require by filtering a column of data within a table. You have the option to sort by date, number, alphabetical order, and more using the sorting tool. The use of sorting and filtering is explored in the example that follows, along with some sophisticated sorting methods.

It is possible to save frequently used filters as filters, queries for analysis, dashboards, reports, tickets, and alerts.

To learn more about filter tool refer to:

brainly.com/question/10169776

#SPJ4

4 0
1 year ago
The _____ feature enables you to represent text as colorful visuals.
Radda [10]

Answer:

complex formatting feature enables you to represent text as colorful

visuals.

mark as brainliest

4 0
2 years ago
Web and mobile applications are created for users to only read information. True False
SIZIF [17.4K]
I think it's false. It's not created just for reading.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Theâ ______ is a large worldwide collection of networks that use a common protocol to communicate with one another.
    5·1 answer
  • The technology (software) that automatically downloads website information to your computer is called ________.'
    15·1 answer
  • The eastern front was longer than other fronts of the war true or false
    7·2 answers
  • A local area network works as a ____ network in that clusters of workstations are connected to a central point (hub or switch) t
    6·1 answer
  • Which guideline should you use when downloading software from the Internet?
    15·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    9·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • lance has three tables in his database. He wants to generate a report to show data from the three tables. Therefore, he decides
    7·2 answers
  • Write programs in python to display “Valid Voter”. (condition : age of person should be
    15·1 answer
  • Answer any one: write a computer program:which you know.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!