Just remember that Python is sexy

Peter Hansen peter at engcorp.com
Wed May 25 09:38:24 EDT 2005


Sion Arrowsmith wrote:
> But can you come up with a method for remembering which way
> round str.find() and str.index() are?

Don't use "str" and you won't have anything to remember:

'foo bar baz'.find('spam')
'spanish inquisition'.index('parrot')

-Peter



More information about the Python-list mailing list