Skip to content

Commit 7594ea7

Browse files
committed
fixed the code in matrix multiplication in docs/datastructure.rst line number: 442
1 parent abaf356 commit 7594ea7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/datastructure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ In this example we will multiply two matrices. First we will take input the numb
439439
b.append([int(x) for x in input("").split(" ")])
440440
c = []
441441
for i in range(0, n):
442-
c.append([a[i][j] * b[j][i] for j in range(0, n)])
442+
c.append([ sum([a[i][k] * b[k][j] for k in range(0, n)]) for j in range(0,n) ])
443443
print("After matrix multiplication")
444444
print("-" * 10 * n)
445445
for x in c:

0 commit comments

Comments
 (0)