Convert a list to set and then convert back from the set to the list, the conversion to the set removes duplication.  There is one weak point the order in the resulted list might be different from the original one, since ‘set’ does not preserves ordering.

 Example:

           l=[1,2,3,1]

           s=set(l)     # this operation removes duplications but data is stored in ‘set’ type

           l=list(s)    # convert back to list

 

5 Responses

  1. Great write-up, I’m regular visitor of one’s blog, maintain up the nice operate, and It’s going to be a regular visitor for a long time.

  2. Thank you for any other excellent post. Where else could anyone get that type of info in such a perfect manner of writing? I’ve a presentation next week, and I’m on the search for such info.

  3. I like what you guys are up also. Such smart work and reporting! Carry on the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my web site 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *