Skip to content

Instantly share code, notes, and snippets.

@un33k
Created April 23, 2014 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save un33k/11225867 to your computer and use it in GitHub Desktop.
Save un33k/11225867 to your computer and use it in GitHub Desktop.
Simple Fabonocci Sequence Creator
def F():
a,b = 0,1
yield a
yield b
while True:
a, b = b, a + b
yield b
def F2():
a, b = 0, 1
yield a
while 1:
a,b = b, a+b
yield b
import time
for a in F():
print "{}\n".format(a)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment