Skip to content

Instantly share code, notes, and snippets.

@lvidarte
Created March 26, 2010 18:45
Show Gist options
  • Save lvidarte/345231 to your computer and use it in GitHub Desktop.
Save lvidarte/345231 to your computer and use it in GitHub Desktop.
fibonacci recursion 2
#!/usr/bin/python
def fibo1(total=10):
a, b = 0, 1
while total > 0:
print a
total = total - 1
a, b = b, a + b
def fibo2(total=5, start=0):
a, b = 0, 1
while total > 0:
if a >= start:
print a
total = total - 1
a, b = b, a + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment