Skip to content

Instantly share code, notes, and snippets.

@DeviaVir
Created April 16, 2017 21:47
Show Gist options
  • Save DeviaVir/c5cff20001a8f0045eaa9ea46edcdc6e to your computer and use it in GitHub Desktop.
Save DeviaVir/c5cff20001a8f0045eaa9ea46edcdc6e to your computer and use it in GitHub Desktop.
def fib():
a, b = 0, 1
while True:
yield a
a, b = b, a + b
def main():
i = int(raw_input())
if i is 0:
return 0
f = fib()
for s in range(0, i + 1):
if s == i:
return next(f)
else:
next(f)
print main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment