Skip to content

Instantly share code, notes, and snippets.

@aromanyuk
Last active February 27, 2016 19:10
Show Gist options
  • Save aromanyuk/d4f7590cbe96472111ec to your computer and use it in GitHub Desktop.
Save aromanyuk/d4f7590cbe96472111ec to your computer and use it in GitHub Desktop.
Python fibonacci loop
def fibonacci(n):
foo = bar = 0
for _ in range(n - 1):
# print foo, bar
if foo == 0:
foo = foo + 1
continue
foo, bar = [foo + bar, foo]
return foo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment