Possible Duplicate:
How can I make my code be a set?
python takes list and returns only if negative value also exists using set
Basically I have a huge list:
# with (n) being a number in the hundreds of thousands or millions
def big_list(n):
return [ randrange(n) for i in range(n) ]
What I need to do is create a new list containing only the elements of big_list(n)
that appear once using set
. I'm really stuck so anything that could point me in the right direction would be awesome!