Answer to Question #239991 in Python for dasuuu

Question #239991

def Matrix(r,c,s):

  a = 1

  Matrix = []

  print("Enter Matrix %s: "%(s))

  for p in range(r):

    try:

      while (a):

        row = [int(i) for i in input().split()]

        if len(row)==c:

          Matrix.append(row)

          break

        

    except ValueError:

      print("Error")

      continue

  return Matrix

rows,columns=map(int,input("Enter the dimensions:").split(",")) 

A = Matrix(rows,columns,"A")

B = Matrix(rows,columns,"B")




Then how do we show these code in a flowchart??


1
Expert's answer
2021-09-21T01:46:46-0400
def Matrix(r,c,s):


  a = 1
  Matrix = []
  print("Enter Matrix %s: "%(s))
  for p in range(r):
    try:
      while (a):
        row = [int(i) for i in input().split()]
        if len(row)==c:
          Matrix.append(row)
          break
    except ValueError:
      print("Error")
      continue
  return Matrix


rows,columns=map(int,input("Enter the dimensions:").split(",")) 


A = Matrix(rows,columns,"A")
B = Matrix(rows,columns,"B")

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