Question: Using python Designing a function's signature is an important skill. We haven't gotten a lot of practice yet, as we absolutely need your functions to
Using python

Designing a function's signature is an important skill. We haven't gotten a lot of practice yet, as we absolutely need your functions to work with our testers, and that has so far meant that we tell you exactly how to interface with the testing scripts. But now, we will describe the signature, and you have to get it correct based upon the needs of the function (how it's supposed to behave). filter_chars: Write the definition for the filter_chars function. It accepts a message as the first argument (call it msg), and an optional argument called keeps as the second argument. Dig through msg, and any character in msg that is also present in keeps gets kept: all others are ignored/skipped. Return this possibly-shorter string. Strings can't be modified, so we can't modify the message. But we can create a new string that only contains the parts we wanted to keep. When keeps isn't provided, all upper and lowercase letters should be kept. Examples: filter_chars("hi there!:)") rightarrow 'hithere' filter_chars("hi there!:)", "ether") rightarrow 'hthere' filter_chars("hi there!: ", "ie: ") rightarrow 'iee: ' filter_chars("hi there!:) ", "1234567890") rightarrow
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
