Chapter 21: Introduction to Recursion Recursion occurs when a function calls itself. Example Python1 2 3 4 5 6 7def factorial(n): if n == 1: return 1 else: return n * factorial(n-1) print(factorial(5)) # Outputs: 120