Import Numpy module as np
Create empty lists.
Get input from the user for number of rows and columns.
Use nested lists to append list.
Print the inverse of the array using np.linalg.inv .
import numpy as np
z, y= [],[]
a, b= int(input()),int(input())
for i in range(a):
for j in range(b):
num=int(input())
z.append(num)
y.append(z)
z=[]
print(y)
var1= np.array(y)
inv = np.linalg.inv(var1)
print(inv)
Thus the program is written to perform Inverse-of-matrix using python programming.