I have figured out the code that takes a list and returns a list where each element only occurs once. But I cannot figure out what I need to do to have to do to eliminate the numbers with no negative counter part:
such as if a list has the numbers [1,-1,2,-2,3]. It will remove the 3 when the list is returned.
So far I have
def one(a):
conversion = set()
conversion_add = conversion.add
elim = [x for x in a if x not in conversion and not conversion_add(x)]
what do I need to do next? If statements, and what syntax do I need to use to compare positive to negative so I can remove the extra number without a negative?
Much thanks