In this python tuple program, we will create a tuple and find an element from the tuple by its index number.
Steps to solve the program
- Create a tuple.
- Find the element from the tuple having index number 2 using tuple_name[index number].
- Print the output.
tup = (4,8,9,1)
print("Number in the tuple with index 2: ",tup[2])
Output :
Number in the tuple with index 2: 9
1 thought on “Create a tuple and find an element from the tuple by its index number”