Created
January 16, 2023 21:40
-
-
Save grantjenks/e2183781758e96e1d49da3025af4f5f7 to your computer and use it in GitHub Desktop.
FizzBuzz
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
from itertools import cycle, slice | |
fizz = cycle('', '', 'fizz') | |
buzz = cycle('', '', '', '', 'buzz') | |
pairs = zip(fizz, buzz) | |
for pair in slice(pairs, 30): | |
print(' '.join(pair)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment