diff --git a/python/exercise1/vowel_counter.py b/python/exercise1/vowel_counter.py index a50949a..e10230e 100644 --- a/python/exercise1/vowel_counter.py +++ b/python/exercise1/vowel_counter.py @@ -2,17 +2,20 @@ def num_vowels(text): """Return the number of vowels in string.""" - vowels = "aeiou" + vowels = "aeiouy" num = 0 for v in vowels: num += text.lower().count(v) return num def num_consonants(text): - vowels = "aeiou" + return len(text) - num_vowels(text) + vowels = "aeiouy" + num = 0 for letter in text: if letter not in vowels: - print("consonant", letter) + num += text.lower().count(letter) + return num text = str(input("Enter a sentence: "))