Skip to content

Instantly share code, notes, and snippets.

@dmjio
Created May 30, 2012
Embed
What would you like to do?
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