Here, we will learn to write the code for the inverse of a matrix.

We will use **numpy.linalg.inv() function** to find the inverse of a matrix.

If we multiply the inverse matrix with its original matrix then we get the identity matrix.

- Import the package numpy.
- An array is initialized using numpy and stored in variable x.
- The array is inversed using the function numpy.linalg.inv(x) .
- Inversed array is stored in variable y.
- Now we’ll print both array x and y.
- Exit

**Algorithm:**

**Code:**

```
import numpy
x=numpy.array([[1,2], [3,4]])
y=numpy.linalg.inv(x)
print(x)
print (y)
```

**Output:**

```
[[1 2]
[3 4]]
[[-2. 1. ]
[ 1.5 -0.5]]
```

Report Error/ Suggestion