Created
June 16, 2018 00:45
-
-
Save sashiyama/7337ec8fba84d8ba3b1944711d0afa58 to your computer and use it in GitHub Desktop.
FizzBuzz
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): | |
if n % 15 == 0: | |
return "FizzBuzz" | |
elif n % 3 == 0: | |
return "Fizz" | |
elif n % 5 == 0: | |
return "Buzz" | |
else: | |
return "" | |
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