l=[]
n=int(input())
for i in range(0,n):
    l.append([int(j) for j in input().split()])
for i in range(n):
    print(l[i])  
print("Reverse")    
l[:]=l[::-1]
for i in range(n):
    print(l[i])   
print("Transpose of reversed matrix is our 90 degrees rotation of matrix")    
for i in range(n):
    for j in range(i):
        l[i][j],l[j][i]=l[j][i],l[i][j]
for i in range(n):
    print(l[i])

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: