Question: 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

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!