print("Hi sir!")
X=list(input("please enter the first matrix X="))
Y=list(input("Please enter the second matrix Y="))
result=list(input("please enter the template of the result matrix in the form of zeros (0)="))
# iterate through rows of X
for i in range(len(X)):
# iterate through columns of Y
for j in range(len(Y[0])):
# iterate through rows of Y
for k in range(len(Y)):
result[i][j] += X[i][k] * Y[k][j]
for r in result:
print(r)
With this code, I get an error that says "can't multiply sequence by non-int of type 'str'".
in this I need the user himself to put the matrices he want however when I put the same matrices in the code editor it works so I think the errors comes from the way of defining the input...