I want to input a matrix in the following form:
1 2 3
4 5 6
7 8 9
I have tried this code
m1=[]
r,c=input().split(" ")
print(r,"and",c)
for x in range (0,r):
for y in range (0,c):
m1[x][y]=input().split(" ")
print("\n")
print (m1)
but get an exception instead:
IndexError: list index out of range