55. Matrix Multiplication using Nested loops with Code || Matrix as Nested List Programming Tutorial

Publicado el: 25 agosto 2022
en el canal de: Ram Case
512
2

You can only multiply two matrices if their dimensions are compatible , which means the number of columns in the first matrix is the same as the number of rows in the second matrix.

Code:

X=[[12,9,3],
[4,5,6],
[7,8,3]]

Y=[[6,8,1,3],
[5,7,3,4],
[0,6,9,1]]

result=[[0,0,0,0],
[0,0,0,0],
[0,0,0,0]]

for i in range(len(X)):
for j in range(len(Y[0])):
for k in range(len(Y)):
result[i][j]+=X[i][k]*Y[k][j]

for r in result:
print(r)


En esta página del sitio puede ver el video en línea 55. Matrix Multiplication using Nested loops with Code || Matrix as Nested List Programming Tutorial de Duración online en buena calidad , que subió el usuario Ram Case 25 agosto 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 512 veces y le gustó 2 a los espectadores. Disfruta viendo!