Archive for March 2nd, 2011
In almost every list processing from various sources, we need to unique elements in the list. Here is an easy method to do so. orig_list = [1,2,"a",3,3,2,"tux"] unique_list = list(set(orig_list)) print unique_list >>> ['a', 1, 2, 3, 'tux'] This doesn’t preserve the order of the list. If you want to preserve the order you [ READ MORE ]
A GNU/Linux enthusiast, Amateur Photographer, Design enthusiast who loves simplicity. An active tweeter @cyriacthomas.
Get every new post delivered to your Inbox.