You seemed to have encountered a bug with codecademy. I tried out your code, and if you put the newlist declaration inside your function, everything works out. However, I tried your code out in a python interpreter and your code works as is.

PS - When you're writing out your question the button that looks like </> allows you to enter code so you don't have to do [tab][tab][tab].

Your declaration of the new list needs to be inside of the function, that it will be in the functions local scope, thus usable in every call of the function. Declaring a new list puts it outside of the function in a global scope, the function cannot write to it.