Answer to Question #206048 in Python for Siva

Question #206048

Write a program for given m*n matrix find its anti diagonal matrix


1
Expert's answer
2021-06-11T14:12:01-0400
M, N = map(int, input().split())
matrix = [list(map(int, input().split())) for i in range(m)]


maximum_sum = M+ N- 2
for s in range(maximum_sum+1):
    for i in range(s+1):
        if i < M and s - i < N:
            print(matrix[i][s- i], end=" ")
    print()

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