Question: Write ( define ) a function named count _ vowels, that takes one argument ( you can safely assume that arguments will always be a

Write (define) a function named count_vowels, that takes one argument (you can safely assume that arguments will always be a strwith a length of at least one). When this function is called, it should return an int that indicates the total number of vowels (a, e, i, o, u) in the argument.
Examples:
count_vowels('hello!') will return 2
count_vowels('bcdfgh') will return 0
count_vowels('aeiou') will return 5
You may wish to write some additional code to test your function. Please be sure that you delete (or comment out) any test code before you submit your solution. The only code in your solution when you submit should be the required function definition.

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 Programming Questions!