Question & Answer: Python Assignment – For Loops…..

Python Assignment – For Loops

Vowel Verifier

Some words contain all five vowels

Use comments to describe your code

Given a word, your application should indicate which vowels, if any, are missing.

If all vowels are present, the application should state that fact.

Note: To receive credit for your work, this application must use a for loop to iterate through the letters of the word.

Expert Answer

 

Hi,

Below is the pyhton code-

def all_five_vowels(word):
vowels = [‘a’,’e’,’o’,’i’,’u’]
for letter in word:
if letter in vowels:
vowels.remove(letter)
if len(vowels) == 0:
return True
print(‘All the vowels are found’)
print(‘Missing vowels are:’ ,vowels)
return False
print(‘All vowels are not found’)
print(all_five_vowels(‘Helloaei’))

Screenshot-

Still stressed from student homework?
Get quality assistance from academic writers!