12. For loop not working as expected



Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4, 5, 4] when it should return [4, 4].

I expected it to complete successfully, but it's not removing all of the odd numbers for a reason I don't understand.

def purify (numbers):
    for x in numbers:
        if x%2==1:
    return numbers


this Instruction is important !!
Do not directly modify the list you are given as input; instead, return a new list with only the even numbers.

I don't understand why two same odd number can't be removed if they are next to each other


Try creating a new empty list and appending your positive results to that.