import numpy as np def sum_matrix(N): my_matrix = *** return *** print(sum_matrix(5)) print(sum_matrix(10)) print(sum_matrix(15)) Create in Numpy a diagonal matrix with elements from N to 0. Count the sum of its values on the diagonal.
import numpy as np def dia(N): my_matrix = np.diag(np.arange(N), k=-1) return np.trace(my_matrix) print(dia(4)) print(dia(12)) print(dia(15))