I'm not sure why this function doesn't work...the error I get is "Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4]." However, I thought that a for loop would iterate through the entire list? Why is one of the 5s purified and the other not? Thanks.
def purify(lizt): for n in lizt: if n % 2 != 0: lizt.remove(n) return lizt