The input is a natural number n — the number of rows and columns in the matrix, the number of matrix elements (integers) line by line separated by a space. draw the maximum element below the main diagonal. The elements of the main diagonal are also taken into account.
def matrix(n): for i in range(n): for j in range(n): print(max(i, j) + 1, end=" ") print() matrix(5)