1# A basic code for matrix input from user
2
3R = int(input("Enter the number of rows:"))
4C = int(input("Enter the number of columns:"))
5
6# Initialize matrix
7matrix = []
8print("Enter the entries rowwise:")
9
10# For user input
11for i in range(R): # A for loop for row entries
12 a =[]
13 for j in range(C): # A for loop for column entries
14 a.append(int(input()))
15 matrix.append(a)
16
17# For printing the matrix
18for i in range(R):
19 for j in range(C):
20 print(matrix[i][j], end = " ")
21 print()