Ask Question
10 February, 18:22

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.

+5
Answers (1)
  1. 10 February, 20:22
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers