x=[[1,2],
[2,4]]
y=[[3,3],
[22,33]]
z=[[0,0],
[0,0]]
for i in range(len(x)):
for j in range(len(x[0])):
z[i][j] = x[i][j] + y[i][j]
for res in z:
print (res)
Algorithm :
- Declare 2 matrix with rows and columns
- Declare 3rd matrix to store the result
- Use for loop to define the length of the matrix
- Add the two matrix and store the result in 3rd matrix
- Finally print the result
Comments :