Purify


#1

Where is my error guys ?
def purify(lists):
lists=int(raw_input("enter numbers"))
for i in lists:
if i%2==0:
lists.remove(i)
print lists


#2

The above line can and should be removed from the function, and the program, in general. It will not result in a list of numbers.

The instructions specifically state,

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

Go back to the drawing board and give it another try. Post back here (in a reply) with your new code if you are still having problems.


#4

A post was split to a new topic: Purify - runs perfectly with pycharm but fails