Python Programming - Console Input/Output - Discussion
Discussion Forum : Console Input/Output - General Questions (Q.No. 61)
61.
How can you prompt the user to enter a sentence and count the number of vowels?
Answer: Option
Explanation:
To prompt the user to enter a sentence and count the number of vowels, use
sentence = input("Enter a sentence: "); print(sum(1 for char in sentence if char.lower() in 'aeiou'))
.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers