Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python function to compute factorial of a number.

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))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Python #function #compute #factorial
ADD COMMENT
Topic
Name
2+7 =