Purify - what's wrong?


Hi all!

I got stucked in this exercise and I don't know why.
I executed that code, using my installed python interpreter and received correct results.
Here on codecademy the following error return:

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

def purify(lst):
    for item in lst:
        if item % 2 == 0:
    return nwlst


...strange things going on here!
I tried again and now it works!
I didn't change anything, the code seems to work!


That worked for me too :slight_smile:

def purify(list):
    results = []
    for item in list:
        if item % 2 == 0:
    return results


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.