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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad