def PrintMatrix(mat): for i in range(len(mat)): for j in range(len(mat[i])): print(mat[i][j], end = ' ') print()