Answer to Question #242850 in Python for Rishi

Question #242850
Given a M x N matrix, write a program to print all Anti-Diagonals elements of matrix
1
Expert's answer
2021-09-30T14:23:58-0400
def ad_elements(matrix):
    m = len(matrix)
    n = len(matrix[0])
    print(*[matrix[i][n - 1 - i] for i in range(min(m, n))])

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS