Purify help


I am stuck.

Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4] when it should return [4, 4].

Replace this line with your code. 
def purify(listonum):
    listonum = list(listonum)
    list2 = []
    for x in listonum:
        if x % 2 == 0:
        return list2


a function ends the moment a return keyword is reached

so, your function ends in the first iteration/run of your loop


I thank you sir! Thank you for your prompt response.


Did you solve the issue and understand why this is important?


as stetim94 says,

so try changing the amount of white-space before or after the return command


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