15. Purify (done what it asks, but im still wrong?)



Oops, try again. Your function crashed on [1] as input because your function throws a "'NoneType' object is not iterable" error.

i don't understand what i did wrong it worked, i followed the instructions it doesn't effect the original list, it creates its own and removes all odd numbers.....so whats the problem i keep getting the same error message (above) thank you for your time :slight_smile:

list_numbers = [1,1,1,1,1,2,3,4,5,6,7,8,2,2,2,2]

def purify(num):
    results = []
    counter = 0
    for x in num:
        if x % 2 == 0:
    counter += 1
    print results

print list_numbers    

print list_numbers


you code is correct , you just should return results not print it



god ■■■■ it, its always the simplest solution that inst obvious. thank you so much it was frustrating me a lot