I wrote my code:
def purify(nums): for i in nums: if i % 2 != 0: nums.remove(i) else: pass return nums
and it returns “Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4].”
Then I watched the solution:
def purify(lst): res =  for ele in lst: if ele % 2 == 0: res.append(ele) return res
and I don’t understand the difference. I mean I wrote even easier but why my code doesn’t work??