mirror of
https://github.com/bikini/patchwork
synced 2026-06-27 08:08:41 +00:00
17 lines
347 B
Python
17 lines
347 B
Python
def fizzbuzz(n: int) -> str:
|
|
if n % 15 == 0:
|
|
return 'FizzBuzz'
|
|
if n % 3 == 0:
|
|
return 'Fizz'
|
|
if n % 5 == 0:
|
|
return 'Buzz'
|
|
return str(n)
|
|
|
|
def main() -> None:
|
|
out = []
|
|
for i in range(1, 21):
|
|
out.append(fizzbuzz(i))
|
|
print(' '.join(out))
|
|
if __name__ == '__main__':
|
|
main()
|