Factorial error in codecademy? Or am I missing something?


My code behaves correctly as shown in the two images that I've attached but I'm receiving error messages indicating that another result contrary to the output screen is occurring. Please advise as to how I should proceed.

Replace this line with your code.


Your function changes its behaviour when it's called multiple times


Why is that? How can I fix it?


Test and investigate. Start by checking that I'm not lying to you and that you agree that this misbehaviour exists.


What I'm seeing is that the error message is running contrary to the output window.


But it's in line with my suggestion for what the problem is


I see the misbehavior in the error message but not in the output from when I follow the code.


How can you reproduce it? (Read my first reply)


Sorry, just not seeing it. I'm receiving the correct outputs in my console. The fact that the error messages say otherwise is confounding. Please provide more direct advice if you can.


If you're testing with one call, then you're not reproducing the scenario where it misbehaves


I reset the list in the function. This provided a resolution to the issue. Thank you.


See. Pretty obvious after just digging into it.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.