Run
import numpy as np # 2D array arr = (np.arange(8)*2).reshape(2,4) # Print array print("The array\n", arr) # Adding a constant to all the elemnets of array output = arr + 3 print("\nAfter adding a constant to all the elemnets of array\n", output)
Output