Skip to content

Instantly share code, notes, and snippets.

@blha303
Created April 9, 2017 07:38
Show Gist options
  • Save blha303/62b4de02826bb404c28f29a83ccf0cf4 to your computer and use it in GitHub Desktop.
Save blha303/62b4de02826bb404c28f29a83ccf0cf4 to your computer and use it in GitHub Desktop.
gotcha fibonacci right here m8
from __future__ import print_function
from sys import stdout
def fib(x,y,f=stdout):
print(x,file=f)
z = x + y
return y,z
def main():
n = (0,1)
while True:
n = fib(*n)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment