Question #218178

Write a program for elements of anti diagonal


Expert's answer

 def anti_diagonal(matrix):
    return [matrix[i][-i-1] for i in range(0, len(matrix))]


matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print(anti_diagonal(matrix))

output:

[3, 5, 7]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS