Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function printStringStats(inputString) that calculates and prints the number of occurrences of each vowel (consider the vowels to be only: a/A, e/E, i/I, o/O,
Write a function printStringStats(inputString) that calculates and prints the number of occurrences of each vowel (consider the vowels to be only: a/A, e/E, i/I, o/O, and u/U) in the given string, and the total number of non-vowels and total number of uppercase letters in the string. NOTE: You must use a loop to count the vowel occurrences. You many not use the Python's built-in count function.
>>> printStringStats("My Octopus")
should print:
'My Octopus' has 0 'a's, 0 'e's, 0 'i's, 2 'o's', 1 'u's, 7 non-vowels, and 2 upper case letters.
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