Purify NameError:


I'm not sure that this is even remotely close to the problem solution but I am having issues with defining my variables. This isn't the first instance where I'm having problems. Can someone illuminate this for me?

Here is the code:

def purify(numbers):
    if i in numbers %2 == 0:
    return pure_list

This returns a NameError: Name "i" is not defined.
I thought that this is an arbitrary variable meant to act as a placeholder. Why does it need to be defined?


it seems you confuse for in and if


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