# Example of a recursive function
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)
print(factorial(5)) # Output: 120
# The above function solves factorial of 5.
# You can tell this is a recursive function, since it calls it self.
# Be warned that a function that calls its self too many times can potentially crash a program and others since it can use up all the memory.
# In our case, it may be prudent to set an upper limit to variable n.