I tried solving this problem using for loop But i am Not getting the correct answers. Can you please help me to figure out my error?

```
=def square_matrix_power(A,n):
B = [item[:] for item in A]
C = [item[:] for item in A]
for n in range(1,n):
for p in range(2):
for q in range (2):
for k in range (2):
C[p][q] += (A[p][k]) * (B[k][q])
B = [item[:] for item in C]
return(C)
```

While trying to print square_matrix(A,2) I am getting the value of A^3.