Skip to content

Commit 8b4549e

Browse files
yodaleeDaniel Watkins
authored and
Daniel Watkins
committed
Add fizzbuzz snippet to tests
1 parent cd940f1 commit 8b4549e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/snippets/fizzbuzz.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def fizzbuzz(n):
2+
if n % 3 == 0 and n % 5 == 0:
3+
return "FizzBuzz"
4+
elif n % 3 == 0:
5+
return "Fizz"
6+
elif n % 5 == 0:
7+
return "Buzz"
8+
else:
9+
return str(n)
10+
11+
n = 1
12+
while n < 10:
13+
print(fizzbuzz(n))
14+
n += 1

0 commit comments

Comments
 (0)