Created
April 16, 2017 21:54
-
-
Save DeviaVir/706fa8b75adfd0d0b3f016332c6a1d2e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib(): | |
a, b = 0, 1 | |
while True: | |
yield a | |
a, b = b, a + b | |
def main(i=0): | |
if i is 0: | |
return 0 | |
f = fib() | |
for s in range(0, i + 1): | |
if s == i: | |
return next(f) | |
else: | |
next(f) | |
while True: | |
try: | |
i = raw_input() | |
if i: | |
print main(int(i)) | |
except: | |
"""Stop.""" | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment