Factorial error in codecademy? Or am I missing something?


#1



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.


#2

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


#3

Why is that? How can I fix it?


#4

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


#5

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


#6

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


#7

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


#8

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


#9

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.


#10

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


#11

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


#12

See. Pretty obvious after just digging into it.


#13

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