Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created February 16, 2009 21:49
Show Gist options
  • Save ashgti/65391 to your computer and use it in GitHub Desktop.
Save ashgti/65391 to your computer and use it in GitHub Desktop.
def matrix_multiplier(a,b):
result = []
print('len: ', len(a[0]), ' and ', len(b[0]))
for i in range(0, len(a[0])):
print("i is: ", i)
result.append([])
for j in range(0, len(b[0])):
print('j is: ', j)
row_sum = 0
for k in range(0, len(b[0])):
print("i: ", i, " j: ", j, " k: ", k)
row_sum += a[i][k] * b[k][j]
result[i].append(row_sum)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment