Purify-Help


#1

def purify(num):
    new=[]
    for x in num:
        if x%2 == 0:
          new.append[x]
    return new

What the heck is wrong with this code ?
error : 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


#2

append() is a built in function (method actually, but methods aren't covered yet) calling a function requires parentheses () not square brackets []


#3

Oh , it was a noob mistake.
Thanks a lot man ! :smiley:


#4