Skip to content

Instantly share code, notes, and snippets.

Last active Nov 6, 2018
What would you like to do?
def fibo_r(x):
if x <= 2:
return 1
return fibo_r(x-1) + fibo_r(x-2)
def fibo_l(x):
l = [0, 1, 1]
if x <= 2:
return 1
for i in range(3, x):
l.append(l[-2] + l[-1])
return l[-2] + l[-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment