deleting list elements

Grant Edwards ge at nowhere.none
Mon Aug 7 15:18:21 EDT 2000


In article <398f08c0_2 at news.newsfeeds.com>, Janos Blazi wrote:
>I'd like to delete some elements of a list li, something like this:
>
>for x in li:
>     if Property(x): 'delete x from the list li'

how about...

li = filter(lambda x: not Property(x), li)

-- 
Grant Edwards                   grante             Yow!  My vaseline is
                                  at               RUNNING...
                               visi.com            



More information about the Python-list mailing list