Purify - runs perfectly with pycharm but fails


#1

def purify(numlist):
new=[]
new=numlist[:]
for num in new:
if num%2 != 0:
new.remove(num),
else:
return num,
return numlist
return new

I wrote this code. it runs perfectly with pycharm but fails to execute here in codecademy. error message displays " ur function fails to purify [1],.. etc" can someone plz help


Purify
#2

instead of copying everything form the old list to the new(then you remove the unwanted elements),
why not just copy only the expected elements to the new list?