0
votes
from numpy import linalg
from numpy import matmul



A = [[1,2],[2,3]]
b = [[5],[2]
Ab = [] 

nrows = 2
ncols = 2
for i in range(0,nrows):
    sum = 0
    for j in range(0,ncols):
        sum = sum + A[i][j] * b[j][0]
    Ab[?] = ?  

print(Ab)

exit()

I am not sure what to put in place of the questions marks " Ab[?] = ?" I tried "Ab[i] = sum" but that does not seem to be working. I need this code to print the results of the multiplied matrices listed in A and b. Is the line "sum = sum + A[i][j] * b[j][0]" right?

also, same typo missing a closing ] in b when copying the question.Sembei Norimaki
that was an error from copying and pastingasapsav
so why do you post the question again if you have answers in the other question?Sembei Norimaki
Its not that question does not give the proper answer in the outputasapsav