Index out of range?

Hi guys,

I tried this solution. It actually returns the correct result, but for some reason Codeacademy doesnt accept it, telling me “index is out of range”. What does this mean?

def odd_indices(lst):
list =
i = 0
while i<len(lst):
i += 1
if i%2 == 0:
return list

There is a final value for i that is equal to len(lst which puts that index out of range. Try,

while i < len(lst) - 1: