# My function appears to produce the right result but isn't accepted

I’m getting what appears to the a correct output after clicking run: [3, 10, -2]

However, I get an error from Code Academy: odd_indices([4, 3, 7, 10, 11, -2]) should have returned [3, 10, -2] , and it returned [3, 10, -2, 3, 10, -2]

Anyone explain what I’m missing? I understand the stated solution, but I’d like to also know what I did wrong on my own.

My code is the following:
new_list =
def odd_indices(lst):
for i in range(1, len(lst), 2):
new_list.append(lst[i])
return new_list

print(odd_indices([4, 3, 7, 10, 11, -2]))
print(odd_indices([4, 3, 7, 10, 11, -2]))
print(odd_indices([4, 3, 7, 10, 11, -2]))
print(odd_indices([4, 3, 7, 10, 11, -2]))

Yes, print(odd_indices([4, 3, 7, 10, 11, -2])) is there also. Not sure of your point. That results in [3, 10, -2], sorry if I didn’t make that clear.

No it doesn’t. Run it.

Don’t know what to tell you. I’ve clicked run dozens of times. I just reset the exercise and put my code back in. Still gives me the same results after clicking run. Don’t know why I’m being so dense about this. Attaching a screenshot.

Well, not sure why when I Run it I get something different. But ok if that is the output, can you tell me what in my code caused the issue?

You still haven’t run the code I posted

(which is what I showed me doing)

putting the code I posted into your editor is how you produce that behaviour

Ah so when you posted the code with no explanation, you were intending me to run it. Pretty new to this so I wasn’t making that assumption. Now that you said run it, I ran it. I see the behavior. I bet I can figure it out logically from here.

No it’s not obvious, but I was trying to get you to do a bit of detective work.

Sure, and I understand what you were trying to do now. That definitely would have been the right kind of push. Just for communication improvement in general it would have helped if the first comment included a Run this. Or when you said “Run it.” in the next comment you would have said something like “Run my code”.