Created
December 28, 2020 18:38
-
-
Save md2perpe/8bb941012125ac2caddb85ad00a62b9e to your computer and use it in GitHub Desktop.
FizzBuzz
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, cycle | |
for (n, d3, d5) in zip(count(0), cycle([True, False, False]), cycle([True, False, False, False, False])): | |
print(("Fizz" if d3 else "")+("Buzz" if d5 else "") or str(n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment