Files
RustPython/tests/snippets/fizzbuzz.py
2018-08-05 10:32:25 -04: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