Skip to content

Instantly share code, notes, and snippets.

@grantjenks
Created January 16, 2023 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantjenks/e2183781758e96e1d49da3025af4f5f7 to your computer and use it in GitHub Desktop.
Save grantjenks/e2183781758e96e1d49da3025af4f5f7 to your computer and use it in GitHub Desktop.
FizzBuzz
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