Answer to Question #279699 in Python for james

Question #279699

We've had enough about numbers, so why don’t we try evaluating characters now?

If you know how to identify what the vowel letters are, and you know how to count up to 5, then you’re good to go!


Instructions:

  1. Using a do…while() loop, continuously scan for characters (one per line) and print it out afterwards. Remember to place a space before the character's placeholder when scanning so that the newline characters will be ignored and the correct values will be scanned.
  2. The loop shall terminate due to either of the following reasons:
  3. The inputted character is a vowel
  4. The number of inputted characters has already reached 5.
  5. For all of the test cases, it is guaranteed that if the number of inputted characters is less than 5, then there must be a vowel from among the inputted characters. Also, it is guaranteed that all the characters are in lowercase.
1
Expert's answer
2021-12-14T13:33:40-0500


i = 1
list1 = input("Enter a string of characters:  ")
list2 = ['a','e','i','o','u']
list3 = list(list1.lower())
x = 0
while True:
    if(i==5 or list3[x] in list2 ):
        break
    else:
        print(list3[x])
    i = i +1
    x = x + 1

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
New on Blog
APPROVED BY CLIENTS