I am trying to find some examples but no luck. Does anyone know of some examples on the net? I would like to know what it returns when it can't find, and how to specify from start to end, which I guess is going to be 0, -1.
you can use
>>> 'sdfasdf'.index('cc') Traceback (most recent call last): File "<pyshell#144>", line 1, in <module> 'sdfasdf'.index('cc') ValueError: substring not found >>> 'sdfasdf'.index('df') 1