Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function called count_vowels() using what we learned this week about Strings. Here are the requirements: 1. function count_vowels takes a parameter of a

Write a function called count_vowels() using what we learned this week about Strings. Here are the requirements:

1. function count_vowels takes a parameter of a String type: count_vowels(mystr)

2. function count_vowels returns a integer of how many vowels there are in the string parameter

3. a vowel is any letter in a, e, i, o, u, A, E, I, O, U

4. function count_vowels collects all the vowels in the string parameter, and prints out all the vowels in one line at the end.

5. here's an example of calling the function and the output:

>>> count = count_vowels("banana")

aaa

>>> count

3

[Checkpoint] Submit the python code (the .py file) in text format, and the screen capture of calling your function with at least two different string arguments and the output. Make sure your program works before submiting it.

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions