Question: Write a short script that will have the user enter in words until the word quit is entered. You will then display a sorted list

Write a short script that will have the user enter in words until the word quit is entered. You will then display a sorted list of words, and list how many vowels appear in each word, next to the word. (Hint: how can we use our string methods to make things easier for us?)

Sample output

Enter a word (quit to stop): hello again 3

Enter a word (quit to stop): again are 2

Enter a word (quit to stop): how hello 2

Enter a word (quit to stop): are how 1

Enter a word (quit to stop): you you 2

####################################

this is my code so far

vowels = 0 words = []

truth = True

while truth: word = input('Enter a word ("quit" to stop): ') words.append(word) words = list(word) for cha in words: if cha == 'a' or cha == 'e' or cha == 'o' or cha == 'i' or cha == 'u': vowels +=1 if word == 'quit': truth = False print("vowels: " + str(vowels)) print(words)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!