Find an index of an element in a tuple

In this python tuple program, we will find an index of an element in a tuple.

Steps to solve the program
  1. Create a tuple.
  2. Find the index of an element in a tuple using index().
  3. Print the output.
				
					tup = ('s','q','a','t','o','o','l','s')
print("Index of a: ",tup.index('a'))
				
			

Output :

				
					Index of a:  2
				
			

program to slice a tuple.

find the length of a tuple.

Leave a Comment