Question: Write a python program a ) Prompt the user to enter an input sentence e . g . Did you hear about the one -
Write a python program
a Prompt the user to enter an input sentence eg "Did you hear about the oneeyed onehorned Flying Purple People Eater?" and save it in a variable named sentence. Your sentence must contain special characters as well, for example, or here. Convert the input sentence into a list format. marks
b Write a function named checkvowelsConsonants that contains the logic to check the number of vowels and consonants in the input. Do not write separate functions for vowels and consonants. Keep in mind that your input contains special characters which are not alphabets therefore, they should not be wrongly identified as vowels or consonants. The expected output for the above sentence is: "The number of vowels is and consonants is marks
c Looping indefinitely Hint: use infinite while loop the program should give the user the options given below and allow the user to select one among them. marks
Print the number of vowels and consonants
exit the program
d Use a set to store the vowels A E I, O U a e i o u marks
e When the user selects option print the number of vowels and consonants in the input sentence. marks
f When the user selects option allow the user to exit the program. Use 'break' to stop the infinite while loop. marks
g Write appropriate function calls for the proper working of the function checkvowels Consonants
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
