Computer Science
Write a program that inputs a line of text and prints out the count of vowels in it.
Python
Python String Manipulation
28 Likes
Answer
str = input("Enter a string: ")
count = 0
for ch in str :
lch = ch.lower()
if lch == 'a' \
or lch == 'e' \
or lch == 'i' \
or lch == 'o' \
or lch == 'u' :
count += 1
print("Vowel Count =", count)
Output
Enter a string: Internet of Things
Vowel Count = 5
Answered By
9 Likes
Related Questions
Write a program to input a line of text and create a new line of text where each word of input line is reversed.
Write a program to input a formula with some brackets and checks, and prints out if the formula has the same number of opening and closing parentheses.
Write a program to input a line of text and print the biggest word (length wise) from it.
Write a program that asks the user for a string (only single space between words) and returns an estimate of how many words are in the string. (Hint. Count number of spaces)