Loading...
Perform element-wise operations between two arrays.
When arrays have the same shape, operations are element-wise:
arr1 + arr2 # Element-wise addition
arr1 * arr2 # Element-wise multiplication
Write a function array_operations(arr1, arr2) that returns a dictionary with:
Return a dictionary with exactly these three keys.
arr1 = [1, 2, 3], arr2 = [4, 5, 6]
{'add': [5, 7, 9], 'multiply': [4, 10, 18], 'dot': 32}add: [1+4, 2+5, 3+6], multiply: [14, 25, 3*6], dot: 4+10+18=32