ID EN
Built-in Types

find

Python 3.11

Return the lowest index in the string where substring sub is found within the slice s[start:end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found.

Syntax

PYTHON
str.find(sub[, start[, end]])

Examples

Example 1
PYTHON
>>> 'Py' in 'Python'
True

See Also

find() in