0
Why on line 5 do we need to use the factorial function?Python
def factorial(x): if x == 1: return 1 else: return x * factorial(x-1) print(factorial(5))
3 Answers
+ 2
For this particular function to work properly, it needs to call itself until x is 1, like Kiibo Ghayal said.