generate functionWed, 08 Feb 2023

Write a program that outputs the number of elements of a square matrix in each row, larger than the arithmetic mean of the elements of this row.

def matrix_size(matrix_list): for row in matrix_list: x = 0 for element in row: x = x + element mean = x/len(row) count = 0 for element in row: if element > mean: count = count + 1 print(count)

Questions about programming?Chat with your personal AI assistant