How to find the square of all elements of a list or a Numpy array?

The numpy.square() function calculates the square of all the elements in a numpy array or list.

Example

import numpy as np
arr = [5,2,6,21,63]
print("Our array: ", arr) 
print("Square of array : ", np.square(arr))