#this is one way to read the matrix if the input given as follows
# r=3
# c=3 the matrix is 3*3 matrix
# 1 2 3
# 4 5 6
# 7 8 9

r=int(input())
c=int(input())
m=[]
for i in range(r):
    m.append([int(j) for j in input().split()])

for i in range(r):
    for j in range(c):
        print(m[i][j],end=" ")
    print()    

Embed on website

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