Question: Python 3 Programming exercise 2 Write a function called mess that takes a phrase (i.e., a string) as input and then returns the copy of

Python 3

Python 3 Programming exercise 2 Write a function called mess that takes

Programming exercise 2 Write a function called mess that takes a phrase (i.e., a string) as input and then returns the copy of that phrase where each character that is one of the last 8 consonants of English alphabet is capitalized (so, r, s, t, v, w, x,y , z) and where each blank space is replaced by dash. For this question, use a for loop over characters of a string, and accumulator. (We will see, or have seen, that in Lecture 8 on Monday). When called from the python shell, your function should behave as follows: >>> mess ('Random access memory '). 'Random-access-memory--'. >>> mess ('central processing unit.') 'centRal-processing---unit

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!