From 832f84dc5b494f21f9ad54e89a67d1d0281eba50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 Nov 2026 03:47:41 +0000 Subject: [PATCH 1/3] Add line_count --- src/tally/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tally/__init__.py b/src/tally/__init__.py index 37248b7..719fdb5 100644 --- a/src/tally/__init__.py +++ b/src/tally/__init__.py @@ -33,3 +33,8 @@ def summary(text): word_label = "word" if words == 1 else "words" character_label = "character" if characters == 1 else "characters" return f"{words} {word_label}, {characters} {character_label}" + + +def line_count(text): + """Return how many lines *text* holds.""" + return len(text.split("\n")) From 01f2dfa4208d363b9d356290aee149fb4fc4b575 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 Nov 2026 03:47:42 +0000 Subject: [PATCH 2/3] Test line_count --- tests/test_tally.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_tally.py b/tests/test_tally.py index a209af6..35b9797 100644 --- a/tests/test_tally.py +++ b/tests/test_tally.py @@ -34,5 +34,10 @@ def test_summary_uses_singulars(self): self.assertEqual(tally.summary("a"), "1 word, 1 character") +class LineCountTests(unittest.TestCase): + def test_counts_lines(self): + self.assertEqual(tally.line_count("one\ntwo"), 2) + + if __name__ == "__main__": unittest.main() From 59eb32df210ef14e7e7feb4ddd6d2106c8ad7080 Mon Sep 17 00:00:00 2001 From: Jeff Bishop Date: Sat, 7 Nov 2026 20:50:01 -0700 Subject: [PATCH 3/3] Run the checks