Answer:
Following are the program in the Python Programming Language.
def vowel(): #define function
print("Enter END to Break") #print message
while(True): #set while loop
word=input("Enter words: ") #get input from the user
count=0 #set count to 0
if(word=="END"): #set if condition
break #terminate the loop
else:
for i in range(len(word)): #set the for loop
c=word[i] #initialize in c
if(c=='a'or c=='e' or c=='i'or c=='o'or c=='u'or c=='A'or c=='E'or c=='I'or c=='O'or c=='U'):
count+=1 #increament in count by 1
print("The word " , word , " contains " , count, end=" ")#print message
if(count==1):#check condition
print("vowel.")
else:
print("vowels")
#call the function
vowel()
Output:
Enter END to Break
Enter words: Vowel
The word Vowel contains 2 vowels
Enter words: END
Step-by-step explanation:
Here, we define a function "vowel()" inside it.
- Print message for the user.
- Set the while loop and pass condition is True then, get input from the user in the variable "word" then, set variable "count" and initialize to 0.
- Set if condition to check if the user input "END" then, the loop will terminate.
- Otherwise, set for loop which continues from the length of the word.
- Then, we set if statement which checks the vowel in the word, then increment in count by 1.
- Print the message in the following format which is mentioned in the question.
- Then, set if-else statement for check count is equal to 1 then print "vowel." Otherwise, it prints "vowels."
Finally, we call the following function "vowel()".