ReferenceTuple methods
tuple.index()
The position of the first matching item in a tuple.
Signature
values.index(item)Parameters
| Name | Means |
|---|---|
item | what to look for |
Returns
An int. Raises ValueError when absent.
Example
Python
values = (1, 2, 3)
print(values.index(3))Output
2