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

My dog, Stella, is playing in the park and sees a tree 100m away. Since she is the dog of a mathematics teacher, she knows how to calculate the angle of elevati
Find the slope of line between(-3,5) and (5,-4)
Find the least common multiple (LCM) of 8y^6+ 144y^5+ 640y^4 and 2y^4 + 40y^3 + 200y^2. You can give your answer in its factored form.
What are the methods in a science text
y = x + 5; x = 3 Find the value of y for the given value of x
What is everyone doing during this coronavirus?
Daisy is making tablecloths for all the picnic tables. She has 15 yards of fabric to make 6 tablecloths. How much fabric will she use for each table cloth?
PLEASE HURRY I HAVE LITTLE TIME ON TEST! I WILL MARK BRAINLIEST TO FIRST ANSWER Which excerpt from A Night to Remember best supports the idea that there is a
Which of the following is an example of a time-bound goal?
How would you describe Vincent Van Gogh’s work ?