Files
RustPython/extra_tests/snippets/example_fizzbuzz.py
2022-05-04 00:53:20 +09:00

15 lines
250 B
Python

def fizzbuzz(n):
if n % 3 == 0 and n % 5 == 0:
return "FizzBuzz"
elif n % 3 == 0:
return "Fizz"
elif n % 5 == 0:
return "Buzz"
else:
return str(n)
n = 1
while n < 10:
print(fizzbuzz(n))
n += 1