Skip to content

Instantly share code, notes, and snippets.

@kozokomiya
Last active June 17, 2017 00:57
Show Gist options
  • Save kozokomiya/013bd5beba6b8e612d08e491ebe09bc2 to your computer and use it in GitHub Desktop.
Save kozokomiya/013bd5beba6b8e612d08e491ebe09bc2 to your computer and use it in GitHub Desktop.
fizz_buzz.py
def fb(n):
ret = ""
if n % 3 == 0:
ret += "Fizz"
if n % 5 == 0:
ret += "Buzz"
return ret
i = 1
while i <= 20:
print i, fb(i)
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment