Answer to Question #188157 in Python for naomi

Question #188157

Write a program that takes an input letter from the user until a vowel is entered.  Use infinite loops (while True:)


1
Expert's answer
2021-05-04T18:37:59-0400
vowels_lower=['a','e','i','o','u']
vowels_upper=['A','E','I','O','U']

while True:
    n=input("Enter a letter: ")
    if n in vowels_lower or n in vowels_upper :
        print("You entered a vowel,",n)
        break

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS