generate functionTue, 28 Feb 2023

Matrix multiplication Write two functions that each multiply two square matrices, one without using numpy's built-in functions, and the other using numpy. The input to the first task is given lists of size size by size elements in each. The second task receives objects of type np.ndarray --- square matrices of the same size. The first function should return a list of lists, and the second should return np.array.

def multiply(a, b): # TODO: your code here return c pass def multiply_numpy(a, b): # TODO: your code here return c pass

Questions about programming?Chat with your personal AI assistant