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)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter