Purify help


#1



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:
            list2.append(x)
        return list2


#2

a function ends the moment a return keyword is reached

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


#3

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


#4

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


#5

as stetim94 says,

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


#6

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