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

You apply to 20 graduate programs, 10 of which are in clinical psychology, 5 of which are in counseling, and 5 of which are in social work. You receive a
What is an Autobiography
Kelp and other various types of seaweeds are examples of ________ .a. green algaeb. blue-green algaec. brown algaed. yellow algae
What are the characteristics of a Market Economy?
What does Para mean in latin?
What is poem and a poetry
why do all normal cells in human body have same number of chromosomes?
What joints do we use when lifting weights?
Use elimination to solve this system of equations. 2r + 3s= 9 and 3r + 2s= 12
If a runner covers 400 meters in 50 seconds, what is the runners average speed? What if the runner takes 60 seconds to cover the same distance?