Skip to content

Instantly share code, notes, and snippets.

@t0yohei
Created June 12, 2021 01:03
Show Gist options
  • Save t0yohei/2bfd8e1014c7e1bd5c465194c6f9fed5 to your computer and use it in GitHub Desktop.
Save t0yohei/2bfd8e1014c7e1bd5c465194c6f9fed5 to your computer and use it in GitHub Desktop.
Just simple fizz_buzz.py sample
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