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

Which is the solution to the inequality? y + 15 < 3​
50 points, Trigonometric Identities - in image: will give brainly to the best answer, help is appreciated :), unreasonable answers will be reported
solve for X x/6 - 7 = -4 x/6 - 7 = -4
which one of the following statments about geothermal power stations is true?choose one:-geothermal power stations use fossil fuels-geothermal power stations us
Please show work. 3. Solve the given inequality and graph the solution on a number line.
what is this poster asking young men to do ?
(hunger games) how does katniss show determination in getting a bow??
solve the equation 4x^2-12x+3=0 by completing the square
Formula valid for all the polygons: P=_______ Formula valid for the pentagon regular: P=______ Measure: P= 11 x _ = _cm
I’ll give brainless