Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python program to count vowels in a string

whatever=input("Enter something
")
vowels = ['a', 'e', 'i', 'o', 'u']
vowelp = ([i for i in whatever if i in vowels])
vowelcount = len([i for i in whatever if i in vowels])
print ("there are", vowelcount, "vowels (y is not counted)")
print ("the vowels are:", vowelp)
 
PREVIOUS NEXT
Tagged: #python #program #count #vowels #string
ADD COMMENT
Topic
Name
2+7 =