Answer to Question #157389 in Python for Andu

Question #157389

1. Write a python function called calculateSum that takes two integer arrays of the same length and calculates the sum array (by adding elements in the same index).

Sample:

Arguments: [2, 5, 6, 5]. [7, 3, 3, 2]

Function will return: (9, 8, 9, 71


1
Expert's answer
2021-01-25T11:39:00-0500

def calculateSum(arr1, arr2):

  res = [x + y for x, y in zip(arr1, arr2)]

  return res


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS