Purify - error[1]


hello am having trouble with the purify exercise.. anytime i run the code below, i get this error

Oops, try again. Your function crashed on [1] as input because your function throws a "'int' object is not iterable" error.

but it works well on an online IDE i use.

def purify(lip):
    if lip==[1]:
        return 0
        for i in lip:
             if i%2 != 0:
    return p


if lip==[1]:
        return 0

here, you should return an empty list. The validation excepts an empty list to be returned, not a integer, that is why you get the error


henestly... i really do not understand you, can you plz explain more


if you purify [1] you should get [], not 0


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