Last active
January 19, 2017 19:54
-
-
Save kstrauser/55d5f240c93a40f1c99df90de9c79dbd 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 count | |
def fizz(): | |
for i in count(1): | |
yield '' if i % 3 else 'fizz' | |
def buzz(): | |
for i in count(1): | |
yield '' if i % 5 else 'buzz' | |
def combine(): | |
for i, f, b in zip(count(1), fizz(), buzz()): | |
yield f + b if f or b else i | |
for _, c in zip(range(100), combine()): | |
print(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment