Skip to content

Instantly share code, notes, and snippets.

@bmjames
Created August 26, 2010 15:09
Show Gist options
  • Save bmjames/551566 to your computer and use it in GitHub Desktop.
Save bmjames/551566 to your computer and use it in GitHub Desktop.
def fib_gen(first=1, second=2):
"Infinite Fibonacci generator"
while True:
next, first, second = first, second, first+second
yield next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment