How to solve indentation error

def square_matrix_power(A, n):
    output = A
    temp = A
    for i in range(n-1):
    # output =  A * output
    # -> output= A * temp
    #  temp = output
    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 = output
return output 

Indentation error i running code what can i do to resolve it?

Push the last statement return output to the same indentation level as others.

1 Like