Question

How to square each element of a matrix in Python?

EXPERT ANSWER

Displaying the square of the elements of a matrix:

Here, a matrix will be created and each element will be multiplied by itself. Each element should be accessed by indices (rows and columns).

Source Code:

- # matrix manipulation in Python
- # displaying elements
- def disp(matrix):
- #