Matrix multiplication using nested loops

Question

Write a function that will feed in two matrices of size M x N, multiply them together, and return the output as a matrix. For example:

# Given the following
# 3x3 matrix
X = [[1,2,7],
    [3,9,6],
    [3,2,5]]
# 3x4 matrix
Y = [[2,3,6,7],
    [2,4,3,0],
    [1,2,5,8]]
# Your code should return...
[13, 25, 47, 63]
[30, 57, 75, 69]
[15, 27, 49, 61]

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now