startswith( prefix[, start[, end]]) Query

Tim Golden mail at timgolden.me.uk
Thu Sep 6 10:20:51 EDT 2007


cjt22 at bath.ac.uk wrote:
> Hi
> 
> startswith( prefix[, start[, end]])  States:
> 
> Return True if string starts with the prefix, otherwise return False.
> prefix can also be a tuple of suffixes to look for. 

That particular aspect of the functionality (the multiple
prefixes in a tuple) was only added Python 2.5. If you're
using <= 2.4 you'll need to use "or" or some other approach,
eg looping over a sequence of prefixes.

TJG



More information about the Python-list mailing list