• This valid solution in not accepted

Question related to mission Index Power

 

I would like to give some feedback about ...

From: http://www.checkio.org/mission/index-power/solve/

HTTP_USER_AGENT:

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36

My Code:

def index_power(array,n):
    if n == 0:
        return 1
    else:
        if n > len (array):
            return -1
        else:
            return array[n]**n