Q. Write a function
remove(data, value)
that returns a new list that contains the same elements as the list data except for those that equal value. Use a list comprehension. Your function should remove all items equal to value. For example, remove([3, 1, 5, 3, 9], 3) should return the list [1, 5, 9].
Down below is what I worked on, but it returns None.
def remove (data,value):
ans = [ data.remove(value) for ele in data if value == ele ]
return ans
assert(remove([3,1,5,3,9], 1) ==[3,5,3,9])
These should work for this function. Please let me know what should I do ??