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))

Comments

Popular posts from this blog

Software Freedom Day 2020

Python