matrix and transpose

PHOTO EMBED

Sat Sep 04 2021 09:25:33 GMT+0000 (UTC)

Saved by @gopalakrishna_c #py

row,col = map(int,input().split())
matrix = []
trans = []
for i in range(row):
    l = list(map(int,input().split()))
    matrix.append(l)
for i in range(row):
    lnew = []
    for j in range(col):
        print(matrix[j][i],end=" ")
        lnew.append(matrix[j][i])
    print()
    trans.append(lnew)
print(trans)

    
content_copyCOPY