Created
June 12, 2021 01:03
-
-
Save t0yohei/2bfd8e1014c7e1bd5c465194c6f9fed5 to your computer and use it in GitHub Desktop.
Just simple fizz_buzz.py sample
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 % 5 == 0: | |
return 'Buzz' | |
elif n % 3 == 0: | |
return 'Fizz' | |
return '' | |
i = 1 | |
while i <= 20: | |
print(i, fb(i)) | |
i = i + 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment