Programming Examples

Implement python script to accept line of text and find the number of characters, number of vowels and number of blank spaces in it.


Implement python script to accept line of text and find the number of characters, number of vowels and number of blank spaces in it.

text = input("Enter a line of text: ")
char_count = len(text)
vowel_count = 0
space_count = 0
for ch in text:
    if ch.lower() in 'aeiou':
        vowel_count += 1
    if ch == ' ':
        space_count += 1
print("Number of characters:", char_count)
print("Number of vowels:", vowel_count)
print("Number of blank spaces:", space_count)
Output/ Explanation:

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad