Answer to Question #190375 in Python for Arbab Abdul basit

Question #190375

Write a function called Matrix_mul that takes two 2D list(matrixes) of 3x3named A & B as a parameter and multiplication result of these two matrix


1
Expert's answer
2021-05-07T07:28:28-0400
def matrix_mul(A, B):
    m = len(A)
    n = len(A[0])
    if n != len(B):
        return
    l = len(B[0])

    C = []
    for i in range(m):
        row = []
        for j in range(l):
            x = 0
            for k in range(n):
                x += A[i][k] * B[k][j]
            row.append(x)
        C.append(row)
    return C

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