• I don't understand how to fix next problem.

Question related to mission Index Power

 

Hi to all! That's my code:

a = [1,2,3,4]

number = 2

def index_power(number, a):

l = len(a)

d = 0

for i in range(0, l):

if i == number:

d = a[i] ** number

return d

elif number > l:

return -1

print(index_power(number, a))

But I got an error message when I run code in Checkio editor:

TypeError: object of type 'int' has no len()

index_power, 4

<module>, 16

But when I run it in Pycharm, function executed without errors. Does anyone know, why this is appear in Checkio?