1If you want to take n lines of input where each line contains m space separated integers like:
2
31 2 3
44 5 6
57 8 9
6
7a=[] // declaration
8for i in range(0,n): //where n is the no. of lines you want
9 a.append([int(j) for j in input().split()]) // for taking m space separated integers as input
1matrix = [input().split() for i in range(no_of_rows)] # if only row is given and the number of coloumn has to be decide by user
2matrix= [[input() for j in range(no_of_cols)] for i in range(no_of_rows)] # if both row and coloumn has been taken as input from user