Imagine I have an n x n matrix. I want to get the sum of each diagonal and print it to the user. For n=3 I can have
matrix =
[[1,2,3],
[1,2,3],
[1,2,3]]
I would get this printed:
sum1 = 3
sum2 = 5
sum3 = 6
sum4 = 3
sum5 = 1
I want to implement it in python. Thanks for helping!