0

tell the factorial up to n

pls.. reply fast

14th Feb 2017, 4:58 PM
harshit
harshit - avatar
2 Answers
+ 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))
14th Feb 2017, 6:09 PM
Shamanth Rai
Shamanth Rai - avatar
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
14th Feb 2017, 10:07 PM
Amaras A
Amaras A - avatar