def skip_two(some_list): result =  for i in range(1, 12, 3): result.append(some_list[i]) return result
What I expected to happen seems to be the right answer (I applied my function to the list in the example section, and it returned the same result).
However, the feedback after submitting the answer was shown as below:
Executing the function
skip_two caused an error:
IndexError: list index out of range .
I don’t get it… I mean the range(1, 12, 3) will count from 1, increment by 3, and stop right before 12 (which is 11). Why would it be out of range…? Please help.
Thanks in advance!