man is very passionate about solving matrix problems.write solving he got stuck in a problem where he was given a m×n integer matrix in python
N = int(input("Number of rows:"))
R = int(input("Number of columns:"))
#describing matrix
matrix = []
print("Enter matrix numbers:")
#for loop used to show matrix and entering rows
for i in range(N):
a =[]
#for loop used to enter column numbers
for j in range(R):
a.append(int(input()))
matrix.append(a)
#for loop used to print matrix
for i in range(N):
for j in range(R):
print( matrix[i][j], end = " ")
print()
Comments
Leave a comment