Delete all items in the list

Peter Billam peter at
Fri Feb 27 01:26:30 CET 2009

On 2009-02-27, Chris Rebert <clp2 at> wrote:
> On Thu, Feb 26, 2009 at 4:08 PM, Peter Billam <peter at> wrote:
>> On 2009-02-26, Clarendon <jineu21 at> wrote:
>>> How do you delete all 'a's?
>> L2 = list(set(L))
>> works for me...
> A. That doesn't by itself remove all the 'a's, although it does
> remove all but 1 'a'
> B. That also removes all but one instance of *everything* in the
> list, not just 'a'
> C. That is lossy in that it completely loses the ordering of the
> original list

Sorry, points taken...

Regards,  Peter

Peter Billam

More information about the Python-list mailing list