[Solved] Error in Factorial Program in Python
You never alter self.n, so it’ll always be greater or equal to 1. You created an endless loop. It’s set to 1 in __init__ so self.n >= 1 is true each time you test. You should not use a local variable and a parameter to track the current state of the factorial function. Pick one … Read more