Compact Solution Works?


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/4?curriculum_id=4f89dab3d788890003000096#


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:
            word.pop(i)
        return i


#2

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.