Skip to content

Instantly share code, notes, and snippets.

@pharshal
Created May 8, 2015 14:54
Show Gist options
  • Save pharshal/100905a6a1496e9b2f09 to your computer and use it in GitHub Desktop.
Save pharshal/100905a6a1496e9b2f09 to your computer and use it in GitHub Desktop.
def febo(length):
ll = []
if length == 0:
return ll
if length == 1:
ll.append(0)
return ll
if length == 2:
ll.append(0)
ll.append(1)
return ll
num1 = 0;
num2 = 1;
ll.append(0)
ll.append(1)
for idx in xrange(length-2):
num = num1 + num2
ll.append(num)
num1 = num2
num2 = num
return ll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment