Extract all words that begin with x

Aahz aahz at pythoncraft.com
Wed May 12 01:18:25 EDT 2010


In article <mailman.84.1273630878.32709.python-list at python.org>,
Terry Reedy  <tjreedy at udel.edu> wrote:
>
>.startswith and .endswith are methods that wrap the special cases of 
>slice at an end and compare to one value. There are not necessary, and 
>save no keystrokes, but Guido obviously thought they added enough to 
>more than balance the slight expansion of the language. They were added 
>after I learned Python and I thought the tradeoff to be a toss-up, but I 
>will consider using the methods when writing didactic code meant to be 
>read by others.

They were also added after I learned Python, and I think they're great!
Using them signals that you're doing simple string checking rather than
some more arcane slicing.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

f u cn rd ths, u cn gt a gd jb n nx prgrmmng.



More information about the Python-list mailing list