Peter Billam wrote:
> On 2009-02-26, Clarendon <jine...@hotmail.com> wrote:
>> Hi. This must be a simple command but I just can't find it in the
>> Phthon manual. How do I delete all items with a certain condition from
>> a list? For instance: > L=['a', 'b', 'c', 'a']
>> I want to delete all 'a's from the list.  > But if L.remove('a')
>> only deletes the first 'a'.  How do you delete all 'a's?
> 
> L2 = list(set(L))
> 
> works for me...

I have to wonder for what value of "works" this works.

The simplest problem is it doesn't remove all the "a"s.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to