Recursion
Recursion is a programming technique where a function calls itself to solve a problem.
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
print(factorial(5)) # Output: 120
Be cautious of infinite recursion. Always define a base case!