Ask Question
14 March, 02:31

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.

+2
Answers (1)
  1. 14 March, 05:24
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers