# How to calculate factorial using recursion python

Factorial of a number is product of all numbers from 1 to that number.

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