So I'm having trouble understanding why this code that I've written doesn't work. By my understanding, this should do the job.
This is the error that I keep getting when I run the code:
Oops, try again. Your function crashed on  as input because your function throws a "list assignment index out of range" error.
Any suggestions with what I have?
def purify(lst): for item in lst: if item % 2 != 0: del(lst[item]) return lst