[Tutor] Filtering out unique list elements

2011-05-03 Thread Spyros Charonis
Dear All, I have built a list with multiple occurrences of a string after some text processing that goes something like this: [cat, dog, cat, cat, cat, dog, dog, tree, tree, tree, bird, bird, woods, woods] I am wondering how to truncate this list so that I only print out the unique elements, i.e

Re: [Tutor] Filtering out unique list elements

2011-05-03 Thread Prasad, Ramit
s', 'tree', 'dog', 'cat', 'wood', 'bird']) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 From: tutor-bounces+ramit.prasad=jpmchase@python.org [

Re: [Tutor] Filtering out unique list elements

2011-05-03 Thread Corey Richardson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 05/03/2011 06:20 PM, Spyros Charonis wrote: > [cat, dog, cat, cat, cat, dog, dog, tree, tree, tree, bird, bird, woods, > woods] > > I am wondering how to truncate this list so that I only print out the unique > elements, i.e. the same list but with

Re: [Tutor] Filtering out unique list elements

2011-05-04 Thread Steven D'Aprano
Spyros Charonis wrote: Dear All, I have built a list with multiple occurrences of a string after some text processing that goes something like this: [cat, dog, cat, cat, cat, dog, dog, tree, tree, tree, bird, bird, woods, woods] I am wondering how to truncate this list so that I only print out