iterating through lists to delete elements

gzeljko gzeljko at sezampro.yu
Thu Aug 9 17:29:48 EDT 2001


From: Skip Montanaro <skip at pobox.com>
> 
> Actually, neither the filter nor the list comprehension solutions posted
> meet the original posters requirements that you iterate through the list and
> delete elements not meeting certain criteria.  If the list has thousands of
> elements, creating a new list may not be a wise choice.
> 

Number of elements is not so relevant here, but expected percentage of
elements to be deleted.

gzeljko








More information about the Python-list mailing list