Purify - function doesn't take only one argument - what's wrong?


This is the error message I get:

"Oops, try again. Does your purify function take exactly one argument (a list of numbers)? Your code threw a "'builtin_function_or_method' object has no attribute 'getitem'" error.

when I use the following code:

new = []
def purify(lst):
for x in lst:
if x % 2 == 0:
elif x == 0:
return new
print new


any input would be much appreciated! :slightly_smiling:


Hi Nikki,

I believe you are trying to pass list new[] as an argument to your function def purify(lst):
but when you call your function "purify()" right at the bottom you do not specify the "new" list there

i have created a seperate code hope this works

`new = [4,5,6]
def purify(lst):
for i in range(0,len(lst)):
if new[i]%2==0:
if new[i]==0:

return lst

print purify(new)`

hope this helps