Ask Question
24 January, 20:34

python Assume letters A, E, I, O, and U as the vowels. Write a program that prompts the user to enter a string and displays the number of vowels and consonants in the string.

+1
Answers (1)
  1. 24 January, 21:00
    0
    vowels = 0

    consonants = 0

    string = input ("Enter string: ")

    for x in string:

    if x. isalpha ():

    if x in "AEIOU":

    vowels + = 1

    else:

    consonants + = 1

    print ("Vowels = ", vowels)

    print ("Consonants = ", consonants)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “python Assume letters A, E, I, O, and U as the vowels. Write a program that prompts the user to enter a string and displays the number of ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers