Reading about Python? Actually practice it. Try PyChallenge free

Python Tutorial

String find

Return the index of a substring (if found). Returns -1 if not found.

Syntax

The format is:
str.find(string)

or

str.find(string,start,end)

Parameters

Example

str = "Tip of the day: "
print( str.find("day") )

Result:

11

Practice
Stop reading. Start writing Python.
PyChallenge gives you interactive exercises in your browser — no install needed.
Practice Python with interactive exercises
Parameter
str The string to search.
start Index to start searching (optional).
end Ending index (optional).