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 e.g. "Did you hear about the one-eyed one-horned 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. [20% 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 26 and consonants is 31".[30% marks]
c) Looping indefinitely (Hint: use infinite while loop), the program should give the user the 2 options given below and allow the user to select one among them. [20% 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.[10% marks]
e) When the user selects option 1, print the number of vowels and consonants in the input sentence. [10% marks]
f) When the user selects option 2, allow the user to exit the program. Use 'break' to stop the infinite while loop. [10% marks]
g) Write appropriate function calls for the proper working of the function checkvowels Consonants().
 Write a python program a) Prompt the user to enter an

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!