Oops, try again. Does your purify function take exactly one argument (a list of numbers)? Your code threw a "object of type 'NoneType' has no len()" error.
and in the small screen top right:
Traceback (most recent call last):
File "python", line 9, in
File "python", line 8, in purify
TypeError: object of type 'NoneType' has no len()

i am stuck

def purify(the_list):
    even_list =[""]
    for i in the_list:
        print i
        if i %2 == 0:
            print i
        print len(even_list)
print  purify([1,2,3])


First, remember that if you put quotations it converts your data to a string.
Next, the lesson wants you to return the data, not print it. You only need one return statement.
Finally, you are on the right track with appending anything with a remainder of zero to the even_list, but check your indentation and the argument you pass in to append().


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