Function Details: index_(tuple)

Description


Returns the index of the first occurrence of the specified value.


Extended Description


The index() method returns the index of the first occurrence of the specified value in the tuple. If the value is not found, it raises a ValueError. Optional start and end parameters can be used to limit the search to a specific slice of the tuple. The search is performed from left to right.


Function Signature


tuple.index(value: Any, start: int = 0, end: int = None) -> int

Module: tuple

Class: tuple

Parameters



Parameter List


  • value: Any
  • start: int
  • end: int

Return


Returns an integer representing the index of the first occurrence of the specified value.


Return Type


int

Output

Explanation

This example shows finding the index of the first occurrence of values in the tuple.