A Python program expects inputs in the range 0 to 100 where…
A Python program expects inputs in the range 0 to 100 where both 0 and 100 are inclusive. Write code in Python that validates the user input. That is, use a loop that asks the user to enter an integer value in the above mentioned range. Any data outside of the given range is invalid and generates an error message and prompts the user to enter another data. Make sure to use descriptive variable names and good programming conventions.
Read DetailsUse Python to write the following functions: A function ca…
Use Python to write the following functions: A function called is_vowel() that takes a single character string as argument and returns True if the character is a vowel, otherwise, the function returns False. Write another function called count_vowels() that accepts a string as an argument and returns the number of vowels that the string contains. count_vowels() should use the is_vowel() function to count the number of vowels in the string. [Extra credit 5 pts] Write a third function called count_consonants() that accepts a string as an argument and returns the number of consonants that the string contains. count_consonants() should use the is_vowel() function.
Read Details