不负相思意
尝试使用这个。请确保您的缩进正确无误:def operations(h,w): """ Takes two inputs, h and w, and makes two Numpy arrays A and B of size h x w, and returns A, B, and s, the sum of A and B. Arg: h - an integer describing the height of A and B w - an integer describing the width of A and B Returns (in this order): A - a randomly-generated h x w Numpy array. B - a randomly-generated h x w Numpy array. s - the sum of A and B. """ A = np.random.random([h,w]) B = np.random.random([h,w]) s = A + B return A,B,sA,B,s = operations(3,4)assert(A.shape == B.shape == s.shape)*