Factorial
Find the factorial for given number using python
Input:
given number is 8
Output:
output is 40320
def fact(n):
if n == 1:
return n;
else:
return n * fact(n-1)
print(fact(4))
Input:
given number is 8
Output:
output is 40320
def fact(n):
if n == 1:
return n;
else:
return n * fact(n-1)
print(fact(4))
Comments
Post a Comment