Purify exercise, Stuck


Hi, I am stuck on how to solve this condition if this value is passed


Your function crashed on [1] as input because your function throws a “‘NoneType’ object is not iterable” error.

def purify(num):
    result = []
    for i in num:
        if i%2 == 0:


weird error, not one that make sense

any way, you don’t return the result, which seems to cause the problem.


@stetim94 yeah your right, can you tell me how return is different from print, and when you would use print and return?


print and return do different things, so when to use depends on what you want to do

Ugh… i feel like i answer this question every other week

return is literally that, it returns (hands something back):

def example():
   return True
# store returned result in x variable
x = example()
# print the returned result
print x


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