Add fizzbuzz snippet to tests

This commit is contained in:
yodalee
2018-08-05 10:32:25 -04:00
committed by Daniel Watkins
parent cd940f13ba
commit 8b4549efbe

View File

@@ -0,0 +1,14 @@
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