I am trying to write matrix multiplication programme.But I am getting error called
"Type Error:Int Object is not iterable".This is my code
def matmult(m1,m2):
r1=[]
r2=[]
for a in range(len(m2[0])):
r1.append(0)
for b in range(len(m1)):
r2.append(r1)
for i in range(len(m1)):
for j in range(len(m2[0])):
for k in range(len(m2)):
r2 += m1[i][k]+m2[k][j]
I am getting error at last line of code.What could be the cause?
Copyright Notice:Content Author:「srinivas chaitanya」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42242581/getting-type-error