import numpy as np array1 = np.array([1, 2, 3]) array2 = np.array([[1, 2], [3, 4]]) n = 5 np.multiply(array1,n) np.multiply(array2,n)