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
den301095 [7]
2 years ago
14

Write a function called sum_arrays that takes two lists of the same length and returns a list where each element is the sum of t

he elements at that index in the original list. The function should return the empty list if the parameters are not the same size.
Computers and Technology
1 answer:
Alekssandra [29.7K]2 years ago
5 0

The function that calls sum_arrays and takes two lists of the same length and returns a list where each element is the sum of the elements at that index in the original list is as follows:

def  sum_arrays(list1, list2):

    if len(list1)==len(list2):

         return [sum(i) for i in zip(list1, list2)]

    else:

         return []

print(sum_arrays( [1, 3, 4, 6, 0], [4, 5, 6, 2, 10]))

<h3>Code Explanation:</h3>

The code is written in python.

  • A function named sum_arrays is declared with its arguments as list1 and list2.
  • We use the if statement to check if the two list are equal in length.
  • If they are equal in length, we add the two list
  • Else we will return an empty list
  • Finally, we call the function with its arguments.  

learn more on function here:brainly.com/question/25589100?referrer=searchResults

You might be interested in
How many responses does a computer expect to receive when it broadcasts an ARP request?why?
Alla [95]

Answer: The response that is expected when it broadcast an ARP request is one or zero.

Explanation: ARP request means Address Resolution Protocol which is a protocol responsible for the mapping of the IP(Internet protocol)address of a system to the MAC(Media Access Control) layer. Only one response is received only if the IP address is present in the ARP otherwise if the IP address does not matches then no response is returned.Thus only one or zero response can be received when a ARP request is process.

5 0
3 years ago
Select the correct answer.
TiliK225 [7]

A group of reviewers with your highest ratings

3 0
3 years ago
A ______ connection provides fast internet service and the ability to exchange large files. ​
Degger [83]

Answer:

broadband

Explanation:

A<u> broadband</u> connection  provides fast internet service and the ability to exchange large files. ​

3 0
3 years ago
BRAINLIEST You have a small company and want to keep your costs low, but it is important your employees share data. Which networ
solmaris [256]

Answer:Peer-to-peer

Explanation: I hope this helps

5 0
3 years ago
Read 2 more answers
The term packet is used fairly generically to refer to protocol data unit (PDU). There are PDU equivalent names in the different
Westkost [7]

Answer:

Bits

Explanation:

The protocol data unit is the representative unit of data in the OSI layer of a network. The OSI system has seven layers.

The physical layer is the first layer of the system and the protocol data unit is represented as bits of data.

Note that the term packet is the PDU for data in the network layer of the OSI network system.

4 0
3 years ago
Other questions:
  • Reputable firms often ask recent graduates to pay an up-front fee for a job.
    12·2 answers
  • What is the best reason to delete Internet browsing history on a regular basis? to solve a computer hardware problem to protect
    13·2 answers
  • Which ergonomic principle helps to maintain good posture?
    7·2 answers
  • A digital media professional's computer is too full of video files. She would like to upgrade her computer to have more capacity
    12·2 answers
  • How does the binary numbering system differ from the hexadecimal numbering system?
    14·2 answers
  • Describe how communication strengthens relationship at work and, as a result, increases your productivity
    9·1 answer
  • A range check that can be used in Microsoft access to calculate the data collected which is date and time
    10·1 answer
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Wht is these things Aᔑ bʖ cᓵ d↸ eᒷ f⎓ g⊣ h⍑ i╎
    15·2 answers
  • Write a method that accepts an integer argument and returns the sum of all the integers from 1 up to (and including) the number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!