I have this tail recursive function here:
def recursive_function(n, sum): if n < 1: return sum else: return recursive_function(n-1
Many recommend that increasing recursion limit is a good solution however it is not because there will be always limit. Instead use an iterative solution.
def fib(n): a,b = 1,1 for i in range(n-1): a,b = b,a+b return a print fib(5)