This commit is contained in:
wittmannzl103469 committed 2026-11-05 15:08:42 +01:00
1 parent de41a02749
commit 9af09cebd3
764 files changed
+54218 -78859

No files matched your search

@@ -0,0 +1,21 @@
from calorie_counting import parse, group_sums, max_calories, top_three
BEISPIEL = "1\n2\n\n5\n\n3\n4\n\n10\n\n6\n"
def test_parse():
# Drei Gruppen: zwei Zahlen, eine Zahl, zwei Zahlen usw.
assert parse("1\n2\n\n5") == [[1, 2], [5]]
def test_group_sums():
assert group_sums(BEISPIEL) == [3, 5, 7, 10, 6]
def test_max_calories():
assert max_calories(BEISPIEL) == 10
def test_top_three():
# 10 + 7 + 6
assert top_three(BEISPIEL) == 23