jaylalemieu2679 jaylalemieu2679
  • 04-09-2019
  • Computers and Technology
contestada

Write a program that prompts the user to enter a text and displays the number of vowels and consonants in the file. Use a set to store the vowels A, E, I, O, and U.

Respuesta :

Аноним Аноним
  • 04-09-2019

Answer:

Using python

Explanation:

fileName = input("Enter the file to check: ").strip()

infile = open(fileName, "r")

vowels = set("A E I O U a e i o u")

cons = set("b c d f g h j k l m n p q r s t v w x y z B C D F G H J K L M N P Q R S T V W X Y Z")

text = infile.read().split()

countV = 0

for V in text:

if V in vowels:

countV += 1

countC = 0

for C in text:

if C in cons:

countC += 1

print("The number of Vowels is: ",countV,"\nThe number of consonants is: ",countC)

Answer Link

Otras preguntas

Choose the best estimate for the capcity of a bath tub A. 5ml B. 500ml C. 50cl D. 500L
Structural isomers are chemical compounds that have
Which US city is best known for celebrating the tradition of Mardi Gras?
PLEASE HELP WILL GIVE BRAINLIEST What is the point and slope of the line represented by the equation below?
help meeee pleaseeeeeeeee
the sum of two numbers is 17. one number is 3 less than 2/3 of the other number. what is the lesser number?​
Making Words, use the letters on the top.​
please help with french 2
In your own words, without providing the formulas, describe the difference between simple interest and compound interest. Which type of interest earns money mo
Freezing water into ice is a ____ change Physical Chemical Nuclear