Write a function main that takes two functions as parameters and the size of the array to be created from these function
Posted: Fri Jun 10, 2022 4:15 pm
Python
Write a function main that takes two functions as parameters and the size of the array to be created from these functions as the third parameter of tuple type. The function should perform elementwise addition of the two arrays and return the resulting array. For example: Test Result print (main (lambda x, y: x+y, lambda x, y: x+y, (3, 3))) [[0 2 4] [2 4 6] [4 6 8]]
Write a function main that takes two functions as parameters and the size of the array to be created from these functions as the third parameter of tuple type. The function should perform elementwise addition of the two arrays and return the resulting array. For example: Test Result print (main (lambda x, y: x+y, lambda x, y: x+y, (3, 3))) [[0 2 4] [2 4 6] [4 6 8]]