Python function to return the factorial of a number


Topic: Python function to return the factorial of a number

Solution

def fact(n):
   if n == 1:
      return n
   else:
      return n * fact(n-1)



List all Python Programs