Skip to content

Instantly share code, notes, and snippets.

Created December 29, 2017 02:59
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 anonymous/3df71c8ab1ab639f512aa06fdd77e68d to your computer and use it in GitHub Desktop.
Save anonymous/3df71c8ab1ab639f512aa06fdd77e68d to your computer and use it in GitHub Desktop.
3と5を使ってはいけないfizzbuzz
def fizz():
while True:
yield from ['', '', 'Fizz']
def buzz():
while True:
yield from ['', '', '', '', 'Buzz']
for i, f, z in zip(range(1, 101), fizz(), buzz()):
if f + z == '':
print(i)
else:
print(f + z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment