So, this is my code:
def purify(lst): lst= for i in lst: if i %2 == 0: lst2.append(i) return lst2
However, both shell and codeacademy exercise throw the error: global name ‘lst2’ is not defined.
I tried adding
global lst2 right at the beginning of my function but it says more or less the same. What am I doing wrong?