import numpy as np def fattLu(A): n = A.shape[0] P = np.eye(n) #stampa matrice con 1 sulla diagonale L =…