Last active
June 17, 2017 00:57
-
-
Save kozokomiya/013bd5beba6b8e612d08e491ebe09bc2 to your computer and use it in GitHub Desktop.
fizz_buzz.py
This file contains 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
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