The index() method searches an element in a tuple and returns its index.
The syntax of index() method for Tuple is:
tuple.index(element)
Example:-
vowels = ('a', 'e', 'i', 'o', 'i', 'u')
index = vowels.index('e')print('The index of e:', index)
index = vowels.index('i')
index = vowels.index('p')
Output:-
The index of e: 1
ValueError: tuple.index(x): x not in tuple