Editor settings

General settings

Save settings

Learn to program with Python

Remove values from a list #

Write a function that removes specified values from the given list. The first argument is the list, and the rest of the arguments are the values to be removed.


Tests #

  • The function remove_values() should accept variable number of arguments
  • remove_values([True, False, None]) should return [True, False, None]
  • remove_values([1, 2, 3, 3, 4], 3) should return [1, 2, 4]
  • remove_values([1, 1, 2, 2, 3, 4, 5, 6], 1, 2) should return [3, 4, 5, 6]
  • remove_values(["Apple", "Banana", "Cherry"], "Apple", "Banana", "Cherry") should return []
  • remove_values(["Hello, 123", "OpenAI GPT-3.5", 42, "Python Programming", 9876, "Data Science 101", 777, "Machine Learning", 1234, "Web Development"], [42, 9876, 777, 1234]) should return ["Hello, 123", "OpenAI GPT-3.5", "Python Programming", "Data Science 101", "Machine Learning", "Web Development"]
Output will be displayed here