ID EN
Built-in Types

index

Python 3.11

Like find(), but raise ValueError when the substring is not found.

Syntax

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

See Also

find() ValueError