Compact Solution Works?


I'm not even sure if this is supposed to work. Thoughts?

def remove_duplicates(x):
    for i in x:
        if i in x == i:
        return i


This will likely give a 'referenced before defined' error since it needs to have already been defined before being part of another definition.

Not to mention we cannot write this sort of expresion for an interable object. This argument must be an iterable for the statement to work.