In this python tuple program, we will find an index of an element in a tuple.
Steps to solve the program
- Create a tuple.
- Find the index of an element in a tuple using index().
- Print the output.
tup = ('s','q','a','t','o','o','l','s')
print("Index of a: ",tup.index('a'))
Output :
Index of a: 2