tuple index in python 1

tuple index in python

# Creating a tuple using ()
t = (1, 2, 4, 5, 4, 1, 2,1 ,1)

print(t.index(5))

Here is what the above code is Doing:
1. We are creating a tuple using ()
2. We are printing the index of the value 5

Similar Posts