Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Program 1 : Sets.py a ) Prompt the user to enter an input sentence e . g . Did you hear about the one -
Program :
Sets.py
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started