Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

How do we decide what symptoms to include in a diagnosis?

Answered: 1 week ago

Question

How do the two components of this theory work together?

Answered: 1 week ago