generate functionWed, 08 Feb 2023

Write a program that outputs the maximum element in the area below the main diagonal of a square matrix.

def max_elem(matrix): # YOUR CODE HERE max_el = -1 for i in range(len(matrix)): for j in range(i): if matrix[i][j] > max_el: max_el = matrix[i][j] return max_el

Questions about programming?Chat with your personal AI assistant