PythiloEasy · 12 min · Task 31 of 100 · progress kept in this browser

Compare matrix diagonals

For a square matrix return the absolute difference between the sums of its two main diagonals. The empty matrix returns zero.

n = 3
for row in range(n):
    print(row, row, n-1-row)
Your task

For a square matrix return the absolute difference between the sums of its two main diagonals. The empty matrix returns zero.