Purify


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/2?curriculum_id=4f89dab3d788890003000096


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:
1
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
        even_list=even_list.append(the_list[i])
        print len(even_list)
print  purify([1,2,3])


#2

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().


#3

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