Last active
October 19, 2019 11:47
-
-
Save hanx11/1d414565fe561f92b205c33532ba0b0b to your computer and use it in GitHub Desktop.
This file contains 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
# -*- coding:utf-8 -*- | |
def fib(n): | |
a, b = 0, 1 | |
for _ in range(n): | |
yield a | |
a, b = b, a + b | |
if __name__ == '__main__': | |
print(list(fib(100))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment