From 3b8b598ad8403e1bc5fdd9ca5ee68f284034b266 Mon Sep 17 00:00:00 2001 From: Eryclis Silva <133433860+Eryclis@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:35:43 -0500 Subject: [PATCH] Update vowel_counter.py Fixing the function num_consonants() --- python/exercise1/vowel_counter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/exercise1/vowel_counter.py b/python/exercise1/vowel_counter.py index a50949a..7c618fa 100644 --- a/python/exercise1/vowel_counter.py +++ b/python/exercise1/vowel_counter.py @@ -10,9 +10,11 @@ def num_vowels(text): def num_consonants(text): vowels = "aeiou" + num_consonants = 0 for letter in text: if letter not in vowels: - print("consonant", letter) + num_consonants += text.lower().count(letter) + #print("consonant", letter) text = str(input("Enter a sentence: "))