I had the same exact problem! I reset the code and did it step by step, running it after each step instead of doing it all together. Maybe that will help you as well ?
Codeacademy is a POS when their own application won’t clear an error, even when you code it correctly.
Multiple exercises found where a user will code it correctly, yet it won’t clear the error.
Thanks for your attention friends i have solved the bug its just simple do it step wise you will not encounter any error. But in coming lessons of data structures they have some bug in exercise 7/13 if you encounter it then just simply refresh or restart the exercise.