Purify error in my code



I am getting
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.

what is wrong in my code?

def purify(numbers):
    list_even = []
    for data in numbers:
        if data % 2 == 0:
    return list_even


.append() is a method call, calling methods and function requires parentheses

square brackets is for accessing string and list by index and dictionary by key


Thanks, it's working :slight_smile: