Created
May 23, 2017 09:32
-
-
Save ericzhong/c8a376674cb0aedc80ce05f9fa05f88e 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 gen(stop): | |
for i in range(stop): | |
yield i | |
f = gen(10) | |
print(type(f)) | |
for i in f: | |
print(i), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment