Skip to content

Commit 7739266

Browse files
authored
Merge pull request #107 from Zafaryab/master
Missing built-in function sum() added, included a loop and changed index variables Thank you.
2 parents 451461b + f35b43a commit 7739266

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/matrixmul.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
b.append([int(x) for x in raw_input("").split(" ")])
1212
c = []
1313
for i in range(0, n):
14-
c.append([a[i][j] * b[j][i] for j in range(0,n)])
14+
c.append([sum([a[i][k] * b[k][j] for k in range(0,n)]) for j in range (0,n)])
1515
print "After matrix multiplication"
1616
print "-" * 10 * n
1717
for x in c:

0 commit comments

Comments
 (0)