Skip to content

Commit b72b57a

Browse files
committed
changed the output of matrix multiplication example in docs/datastructure.rst
1 parent 7594ea7 commit b72b57a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/datastructure.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ The output
464464
3 2 1
465465
After matrix multiplication
466466
------------------------------
467-
9 12 9
468-
32 25 12
469-
49 32 9
467+
30 24 18
468+
84 69 54
469+
138 114 90
470470
------------------------------
471471

472472
Here we have used list comprehensions couple of times. *[int(x) for x in input("").split(" ")]* here first it takes the input as string by *input()*, then split the result by " ", then for each value create one int. We are also using *[a[i][j] * b[j][i] for j in range(0,n)]* to get the resultant row in a single line.

0 commit comments

Comments
 (0)