**Hi**

**please explain why it it considering (n-1)iteration in for loop**

def matrix (A,n):

```
output=[i[:] for i in A]
temp=[i[:]for i in A]
for i in range (n-1):
output [0][0]= A[0][0]* temp [0][0]+ A[0][1]* temp [1][0]
output [0][1]= A[0][0]* temp [0][1]+ A[0][1]* temp [1][1]
output [1][0]= A[1][0]* temp [0][0]+ A[1][1]* temp [1][0]
output [1][1]= A[1][0]* temp [0][1]+ A[1][1]* temp [1][1]
temp = [i[:] for i in output]
return output
```

print (matrix (A,1))