14/15 remove duplicates (Correct but is my code simple, efficient and concise?)


#1

def remove_duplicates(elements):
old = [ ]
new = [ ]
for i in elements:
if i not in new:
new.append(i)
return new


#2

That is exactly how I would do it! :slightly_smiling:


#3

Thx julianchee, the really looks like the best way to think about it. I don't
think you need the old = [] list tho.