Skip to content

Instantly share code, notes, and snippets.

@harunyasar
Last active August 29, 2015 14:20
Show Gist options
  • Save harunyasar/f00f862d639460bb8c58 to your computer and use it in GitHub Desktop.
Save harunyasar/f00f862d639460bb8c58 to your computer and use it in GitHub Desktop.
Simple Fibonacci generator
def fibo():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
# usage
f = fibo()
f.next()
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment