Skip to content

Instantly share code, notes, and snippets.

@niyaton
Created June 19, 2013 13:50
Show Gist options
  • Save niyaton/5814471 to your computer and use it in GitHub Desktop.
Save niyaton/5814471 to your computer and use it in GitHub Desktop.
なんとなくFizzBuzz書いてみた.
def gen_fizz_buzz(n):
for i in xrange(1,n):
str = ""
if i % 3 == 0:
str += "Fizz"
if i % 5 == 0:
str += "Buzz"
yield str if str else i
for i in gen_fizz_buzz(100):
print i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment