Help with error - your function fails on


#1

def purify(liste):
for i in liste:
if i == 0 or i == 1:
liste.remove(i)
elif i % 2 == 1:
liste.remove(i)
return liste

This is the error I get:
Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4].

Thanks so much!


12/15 purify error
#2

Remove is a horrible method to use for this problem, because it is making things far more complicated, i recommend appending even numbers to a new list