[Tutor] if item.find(extension)!= -1: -- what's the -1?
ldl08 at gmx.net
Sun Feb 7 02:29:20 CET 2010
Thank you Wayne, Kent,
it's easy to see clearly once told what to focus on ;-)
On 07/02/10 00:35, David wrote:
> Hello again,
> in Knowlton's 2008 book "Python: Create, Modify, Reuse" the author makes
> frequent use of the term -1 in his code, but doesn't tell to what aim.
> For want of search terms Google is not helpful. Could someone please
> enlighten me by means of a one-liner as a reply?
> Thank you!
> Example Code:
> for item in filelist:
> if item.find(extension)!= -1:
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
More information about the Tutor