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
def calculateSum(arr1, arr2):
res = [x + y for x, y in zip(arr1, arr2)]
return res
Comments
Leave a comment