Count the number of vowels in a string Program to Count the Number of vowels we’re going to check how many vowels are present in a given String . There are five vowels in English vocabulary, they are ...
count_vowels = sum(1 for char in text if char in vowels) count_consonants = sum(1 for char in text if char.isalpha() and char not in vowels) ...