Question: Complete the change_case(text) function that takes a single string parameter text. The function returns a new string where the vowels in the parameter text are

Complete the change_case(text) function that takes a single string parameter text. The function returns a new string where the vowels in the parameter text are all in uppercase, and the consonants in the parameter text are all in lowercase. Non-alphabetical characters remain unchanged. Some examples of the function being called are shown below.

For example:

Test Result
text = "Damir" new_text = change_case(text) print(text, "--->", new_text)
Damir ---> dAmIr
text = "Hello World" new_text = change_case(text) print(text, "--->", new_text)
Hello World ---> hEllO wOrld

Answer:(penalty regime: 0, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50 %)

1

2

3

def change_case(text):

consonants = "bcdfghjklmnpqrstvwxyz"

vowels = "aeiou"

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!