FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonprogram/Matrix Multiplication in Python at master · codedoc7/pythonprogram · GitHub
codedoc7
pythonprogram
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonprogram
/
Matrix Multiplication in Python
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (22 loc) · 481 Bytes
Breadcrumbs
pythonprogram
/
Matrix Multiplication in Python
Copy path
File metadata and controls
28 lines (22 loc) · 481 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def matrix_multiplication(M,N):
R = [[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]]
for i in range(0, 4):
for j in range(0, 4):
for k in range(0, 4):
R[i][j] += M[i][k] * N[k][j]
for i in range(0,4):
for j in range(0,4):
print(R[i][j],end=" ")
print("\n",end="")
M = [[1, 1, 1, 1],
[2, 2, 2, 2],
[3, 3, 3, 3],
[4, 4, 4, 4]]
N = [[1, 1, 1, 1],
[2, 2, 2, 2],
[3, 3, 3, 3],
[4, 4, 4, 4]]
matrix_multiplication(M,N)
Back
|
FazBrowse Home
|
New Git URL