diff --git a/word-count/example.py b/word-count/example.py index 367f2d2205..121268dad0 100644 --- a/word-count/example.py +++ b/word-count/example.py @@ -5,4 +5,4 @@ def word_count(text): """Return a Counter object that maps from the words contained in the phrase to their respective counts """ - return Counter(text.split()) + return Counter(text.lower().split()) diff --git a/word-count/word_count_test.py b/word-count/word_count_test.py index c0dc141493..0f656c11ac 100644 --- a/word-count/word_count_test.py +++ b/word-count/word_count_test.py @@ -36,8 +36,8 @@ def test_include_numbers(self): def test_mixed_case(self): self.assertEqual( - {'go': 1, 'Go': 1, 'GO': 1}, - word_count('go Go GO') + [3], + list(word_count('go Go GO').values()) ) def test_multiple_spaces(self):