Question: Using python 3 write a function named replace_chars (use this exact name) The function has two parameters: first a string; second a list of characters
Using python 3
write a function named replace_chars (use this exact name)
The function has two parameters: first a string; second a list of characters
Write a docstring describing its purpose which is to return a modified version of its string parameter where all characters that are included in the list have been changed to the space character
Write three unit tests
Here is one you can use: test.testEqual(replace_chars(" SampIEam*", ["p", "E", "*"]), " Sam I am ")
Write two more unit tests of your own
Implement the replace_chars function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
