python using set to create list of elements that only appear once [duplicate]
问题 This question already has answers here : Closed 8 years ago . 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