Advertisements
Advertisements
Question
Consider the following tuples, tuple1 and tuple2:
tuple1 = (23,1,45,67,45,9,55,45)
tuple2 = (100,200)
Find the output of the following statement:
print(tuple1.index(45))Short/Brief Note
Advertisements
Solution
The 'index()' function returns the index of the first occurrence of the element in a tuple.
OUTPUT:
2
shaalaa.com
Tuple Methods and Built-in Functions
Is there an error in this question or solution?
