On Wed, 25 Aug 2010 01:44:22 am Evert Rol wrote: > Why are you returning -1 here? > -1 is a valid list index. So? str.find() does the same thing. It guarantees to only return 0 or positive indexes if it finds the substring, and only returns -1 to indicate not found. -- Steven D'Aprano