Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions helloworld.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
def get_greetings():
return 'Hello World!'


def fizzbuzz(i):
if i % 3 == 0 and i % 5 == 0:
return 'fizzbuzz'
elif i % 3 == 0:
return 'fizz'
elif i % 5 == 0:
return 'buzz'
else:
return str(i)
5 changes: 5 additions & 0 deletions helloworld_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from helloworld import get_greetings
from helloworld import fizzbuzz


def test_get_helloworld():
assert get_greetings() == 'Hello World!'
assert fizzbuzz(1) == '1'
assert fizzbuzz(3) == 'fizz'
assert fizzbuzz(5) == 'buzz'
assert fizzbuzz(15) == 'fizzbuzz'