Skip to content

Instantly share code, notes, and snippets.

@kevinslin
Created December 17, 2011 18:27
Show Gist options
  • Save kevinslin/1490982 to your computer and use it in GitHub Desktop.
Save kevinslin/1490982 to your computer and use it in GitHub Desktop.
Simple Fibonacci finder
#python, #elegant, #example
def fib(n):
" Generate fib sequence up to n "
a, b = 0, 1
while (b < n):
print b
a, b = b, a + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment