Count Vowel Occurrences
EasyPractice library · +10 XPdynamic programmingstringsiteration
Given a string S, consisting of lowercase English letters, count the total number of vowels ('a', 'e', 'i', 'o', 'u') present in the string. Print this count.
Input
A single line containing the string S.
Output
A single integer representing the total count of vowels in S.
Constraints
The length of S is between 1 and 1000, inclusive.
Time limit 1 s (native code; slower languages get more)Memory 256 MB14 hidden tests
Example 1
Input
programming
Output
3
The vowels are 'o', 'a', 'i', so the count is 3.
Example 2
Input
aeiouaeiou
Output
10
All characters are vowels, so the count is 10.
Hints
# Read the input from stdin and print the answer.
import sys
def main():
data = sys.stdin.read().split()
# your code here
main()
Example 1 input
programming
Example 2 input
aeiouaeiou