Created
August 22, 2018 16:53
-
-
Save thisfred/2283d824ba49000cafc3c49ea9b93488 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
from itertools import izip | |
def main(): | |
original = izip(range(10), range(10)) | |
counts = [0] | |
def counting(wrapped): | |
for i in wrapped: | |
counts[0] += 1 | |
yield i | |
for i in counting(original): | |
print(i) | |
print(counts[0]) | |
main() |
Author
thisfred
commented
Aug 22, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment