jasminewavy3163 jasminewavy3163
  • 12-03-2020
  • Computers and Technology
contestada

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.

Respuesta :

abdullahfarooqi
abdullahfarooqi abdullahfarooqi
  • 16-03-2020

Answer:

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)

Explanation:

Answer Link

Otras preguntas

at the car wash, we helped dad was the car. what is the subject
.What is geothermal heat? How does Iceland get its energy for heat and electricity?
give an example of how a functional group can affect the properties of an organic compound
Which structure provides energy to the cell?
The period of function f(x) = sec(x/4) is
List atleast to conditions that could cause the pressure inside a sealed container of gas to increase
All three trains just arrived at the station. When will they next all arrive at the same time? Key. red train 8 min. Blue train 10 min. Yellow train 12 minutes
show me an example of multiplying decimals
Find the sale of the item. Round to two decimal places if necessary. Original price: $250.99 Markdown: 78% The sale price is ____ (Please include how to do it b
You can infer that Carrie is what