[Tutor] Removing lines in string-table

Olli Rajala olli.rajala at gmail.com
Tue May 17 15:48:40 CEST 2005


>      Looks like a job for a list comprehension:
> 
> fileNames = [element for element in fileNames if not element.endswith
> ("_thumb.jpg")]

Thanks Max! It seem to work, but now I have to do some reading,
because I have no idea why it works or what it really does. :) But
thanks anyway.

Yours, 
-- 
Olli Rajala <><
Tampere, Finland
http://www.students.tut.fi/~rajala37/

"In theory, Theory and Practice should be
the same. But in practice, they aren't."
- Murphy's Proverbs


More information about the Tutor mailing list