7/15 Works in iPython Notebook but not Codecademy


#1

Any suggestions? This works in iPython Notebook but not Codecademy.


#2

can you put your code here?


#3

I reposted it above. Can you see it now?


#4

try to return the new_word instead of print it

return new_word

#5

That worked! Thanks so much! Is that just the way codecademy works?


#6

That's because returning the new_word will give the new_word as a token back to its caller this will allow code academy to get that token and test it but when you print it there is no way they can get a hold of it and test it against the expected result


#7

Would someone please explain why index = -1 before entering the for loop?

I DO understand why you would want to subtract 1 from index through each iteration of the loop. However, I DON'T understand why it is set to -1 to begin.