Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created May 4, 2014 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyonschu/07d66c402b14bdb6c398 to your computer and use it in GitHub Desktop.
Save hyonschu/07d66c402b14bdb6c398 to your computer and use it in GitHub Desktop.
collect=[]
def fib(length):
first = 1
second = 1
if length < 2:
return length
else:
collect = [0,1,1]
length = length-2
for i in range(length):
temp = first
first = second
second = temp+first
print collect
collect.append(second)
return collect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment