what is this error?

def purify(numbers):
    for i in numbers:
        if i%2==0:
    return even

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.


.append() is a built in function to append items, but this requires parentheses, not square brackets.


My code is almost exactly the same, and has appropriate parentheses, but it's still throwing an error code

def purify(unknown):
    for i in unknown:
        if i % 2 == 0:
            final =final.apprend(i)
    return final

(indentions are identical to the original post's)

Throwing error: "Your code looks a bit off--it threw a "'list' object has no attribute 'apprend'" error. Check the Hint if you need help!"


append() will append to the list, no need to update the variable as well. append() is taken care of this for you


But even when I take out the "final = " from in front of the append(), I get the same error. This is very frustrating.


append shouldn't have the letter r in it (you have apprend)


Durp. Thank you so much.


A post was split to a new topic: Purify


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