From 28e362f63fff5b36789cdc43937746529ece3604 Mon Sep 17 00:00:00 2001 From: Donald Calloway Date: Thu, 2 Oct 2025 08:53:18 -0700 Subject: [PATCH] Modified matrix_mult to be a module --- matrix_mult.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/matrix_mult.py b/matrix_mult.py index e487ac1..6258ac0 100644 --- a/matrix_mult.py +++ b/matrix_mult.py @@ -22,6 +22,9 @@ Example: ... ] >>> multiply(M, N) [[7, 14], [3, 6]] + +NOTE: If you import the matrix_mult module into another project, call it with matrix_mult.multiply(M, N). + """ @@ -36,18 +39,4 @@ def multiply(M: List[List], N: List[List]) -> List[List]: for k in range(mcols): result[i][j] += M[i][k] * N[k][j] return result - - - -M = [ - [1, 2, 4], - [0, 1, 2] -] - -N = [ - [1, 2], - [3, 4], - [0, 1] -] - -print(multiply(M, N)) \ No newline at end of file +