• Check this code

 

I would like to give some feedback about ...

This code runs ok when I click "Run" and I've tested using my Python interpreter at home. Thanks.

def index_power(array, n): result = -1 size = len(array) if n >=0 and n < size: result = array[n]*array[n] return result

if name == 'main':

print(index_power([1,4,7,9,14,20],1))

From: https://py.checkio.org/mission/index-power/solve/

HTTP_USER_AGENT:

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36