Created
October 5, 2016 13:32
-
-
Save docapotamus/896192c5eed7d85854344c436f4806b8 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
>>> def func1(): | |
... for i in xrange(10): | |
... yield i | |
... | |
>>> def func2(): | |
... for i in func1(): | |
... print i | |
... | |
>>> func1() | |
<generator object func1 at 0x7feb54159960> | |
>>> func2() | |
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment