Run
import numpy as np #2D array a = (np.arange(8)*2).reshape(2,4) #print array print("The array\n",a) #multiplying a constant to all the elements of array b = a * 3 print("\nAfter multiplying a constant to all the elements of array\n",b)
Output