7/15 Works in iPython Notebook but not Codecademy


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


can you put your code here?


I reposted it above. Can you see it now?


try to return the new_word instead of print it

return new_word


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


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


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.