Skip to content

Instantly share code, notes, and snippets.

@dmjio
Created May 30, 2012 18:50
Show Gist options
  • Save dmjio/2838259 to your computer and use it in GitHub Desktop.
Save dmjio/2838259 to your computer and use it in GitHub Desktop.
fibonacci in python
def fib(n):
#display fib numbers from 0 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