generate functionFri, 10 Feb 2023

Write a program that prints the maximum element of a square matrix below the main diagonal. The elements of the main diagonal are also taken into account.

import numpy as np def matrix (mat): mat=np.array(mat) for i in range(len(mat)): for j in range(len(mat[1])): if i+j==len(mat)-1: print(max(mat[:,j])) matrix([[1,2,3],[4,5,6],[7,8,9]])

Questions about programming?Chat with your personal AI assistant