Answer to Question #283340 in Python for Bapu

Question #283340

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

1
Expert's answer
2021-12-28T10:26:52-0500
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()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS