Home / Python / Reference / Tuple methods

Python tuple index() method

Return the position of the first item equal to a value.

Syntax

tuple.index(value)

Raises ValueError if it is missing.

Parameters

valuewhat to find

Return value

int

Example

Code

days = ("Mon", "Tue", "Wed")
print(days.index("Tue"))

Output

1

Related

Learn it step by step in the free lesson Lists & Tuples, with exercises that check your answers.