You can download this code by clicking the button below.
This code is now available for download.
Calculates the factorial of a number, which is the product of the number and all positive integers less than it.
Technology Stack : Recursive
Code Type : Recursive function
Code Difficulty : Intermediate
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)