1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
____ [38]
4 years ago
5

(Count consonants and vowels) Write a program that prompts the user to enter a text in one line and displays the number of vowel

s and consonants in the text. Use a set to store the vowels A, E, I, O, and U. Sample
Computers and Technology
1 answer:
kkurt [141]4 years ago
5 0

Answer:

The program to this question as follows:

Program:

s= input("Please Enter your String : ")#input value from user in String variable  

vowel= 0 #defining integer variable

consonant= 0 #defining integer variable

for i in s: #defining for loop for count vowel and consonant

   if(i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u'

   or i == 'A' or i == 'E' or i == 'I' or i == 'O' or i == 'U'): #if block that check vowels

       vowel = vowel + 1 #adding value in vowel variable

   else: # count consonant

       consonant = consonant + 1 #adding value in consonant variable

print("Number of Vowels: ", vowel) #print vowel

print("Number of Consonant: ", consonant) #print consonant

Output:

Please Enter your String : Database is a collection row and column

Number of Vowels:  14

Number of Consonant:  25

Explanation:

In the above python code three variable "s, vowel, and consonant" are defined, in which variable s is used to input a string value from the user end, and the "vowel and consonant" variable is used to count their values.

  • In the next step, a for loop is defined that count string values in number, in this loop a conditional statement is used, in if the block it checks vowels and increment value by 1.
  • In the else block it count consonant value and uses print function to print both variable "vowel and consonant" value      
You might be interested in
Which of the following is not true of both the ACT and the SAT?
nlexa [21]
The answer for that is c
6 0
4 years ago
Read 2 more answers
In order to practice as a lawyer specializing in digital media (or as a lawyer of any kind), you need to pass the state exam.
larisa [96]
The uniform bar exam
4 0
3 years ago
Eddie typed a word, used the undo command, and then decided he really wanted to keep the word. Eddie should _____.
9966 [12]

Sense Eddie clicked the undo command he wouldn't want to click it again, if he does more words will leave. Sense he did not copy the word, he cannot paste it. And if he would press Undo twice, then that would take him back further, so what he wants to do is click the redo command.


Hope this helps.


<u><em>Marcy~</em></u>

7 0
4 years ago
Read 2 more answers
A hard disk is a ____ storage device.<br> S A E N O Y R C D<br><br> Unscramble the letters
nika2105 [10]
The correct answer is secondary
5 0
3 years ago
What are the two main charaters from maid sama?
Gennadij [26K]

Answer:

Takumi Usui and Misaki Ayuzawa

Explanation:

don't know why this is here

8 0
3 years ago
Read 2 more answers
Other questions:
  • "a web server that is​ specially-built to manage and deliver business intelligence is called a​ _________."
    7·1 answer
  • Derek has an interest in designing video games. What requirements should he fulfill to be a game designer?
    13·1 answer
  • PLEASSEE HELP ILL GIVE U A BRAINLIEST IF UR RIGHT!!
    13·2 answers
  • A mule deer can run 1/4 mile in 25 seconds. Which of the following correctly shows this rate as miles per hour?
    5·1 answer
  • The Outline tab and the Slides tab can be open at the same time.
    7·1 answer
  • Arrange the following units of storage in descending<br> order. B, TB,KB, GB,MB
    5·1 answer
  • What invention was key to computers being moved into homes and personal use?
    10·2 answers
  • A(n) ____is a network of organizations and activities needed to obtain materials and other resources, produce final products, an
    7·1 answer
  • Which statement about technology before the invention of the printing press is true?
    8·1 answer
  • What is added to brining liquid to add flavour​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!