logo CodeStepByStep logo


Language/Type: Python collections list

Write a function named remove_all that accepts as a parameter a list of strings along with an element value string, and returns a new list that is the same as the parameter list but with all occurrences of that string removed. For example, if a list named l contains ["a", "b", "c", "b", "b", "a", "b"], the call of remove_all(l, "b") should return ["a", "c", "a"].

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.