[Tutor] if item.find(extension)!= -1: -- what's the -1?

David 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 ;-)

David


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!
>
> David
>
>
> Example Code:
>
> for item in filelist:
> if item.find(extension)!= -1:
> snaplist.append(item)
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



More information about the Tutor mailing list