recursion
a function that repeatidly calls itself until a base case is met
provides an elegant (code is very simple and minimal) way to carry out the same operation a number of times
recurtion has three essential characteristics
stopping conditions
required or the routine never “unwinds”
Avoids endless recursion
recursion code example
def factorial(n):
if n ==1:
return 1
else:
return n*factorial (n-1)