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

what is the scientific study of the atmosphere called?
Here goes my 2 question
0.89 rounded to one decimal place
whom are the witches preparing to meet in scene 3 of macbeth?
marge cuts 16 pieces of tape. each piece is 3/8 inches long. how much tape did she use
name the longest of the side of three rectangle that have for Perimeters of14 unit
What formulas are used to find the area of a: Triangle Rectangle Square Parallelogram
3/4 of students in your classroom listen to rap music only. 1/2 of these students are boys. What fraction of students in your classroom are boys who listen to
How many times can 26 go into 59
use a calculator to solve each equation: -5.5x + 0.56 = -1.64 -4.2x + 31.5 = -65.1 k/5.2 +81.9 =47.2