I tried searching and couldn't find this exact situation, so apologies if it exists already.
I'm trying to remove duplicates from a list as well as the original item I'm searching for. If I have this:
ls = [1, 2, 3, 3] I want to end up with this:
ls = [1, 2] I know that using set will remove duplicates like this:
print set(ls) # set([1, 2, 3]) But it still retains that 3 element which I want removed. I'm wondering if there's a way to remove the duplicates and original matching items too.