I'm stuck at the purify exercice of the python course. My code doesn't works, and I don't understand why.
it returns "Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4]. "
It seems it looks like the index is shifting. But I don't understand why, since I'm writing on one other list than the one used in the for. I'm really lost.
def purify(x): y = x for item in x: if(item % 2 != 0): y.remove(item) return y
Thanks in advance.