I keep getting an error saying "Your function fails on purify([4,5,5,4]). It returns [4,5,4] when it should return [4,4]."
I'm not sure why the other 5 is not being removed from the list. I found another solution using the append function to add only the even numbers to a new list, but is there a way to remove the odd numbers from the list instead?
Replace this line with your code. def purify(numbers): x = list(numbers) for i in x: if i % 2 != 0: x.remove(i) return x