I have this tail recursive function here:
def recursive_function(n, sum): if n < 1: return sum else: return recursive_function(n-1
We could also use a variation of dynamic programming bottom up approach
def fib_bottom_up(n): bottom_up = [None] * (n+1) bottom_up[0] = 1 bottom_up[1] = 1 for i in range(2, n+1): bottom_up[i] = bottom_up[i-1] + bottom_up[i-2] return bottom_up[n] print(fib_bottom_up(20000))