0
tell the factorial up to n
pls.. reply fast
2 Respostas
+ 1
def factorial(n):
if n == 0:
return 1
else:
return n*factorial(n-1)
n=int(input("Input a number to compute the factiorial : "))
print(factorial(n))
0
With crude testing, Python on my computer hits the max recursion depth at about 900 or so. Very efficient as you will never use something like that, ever