Computer Science, asked by oneone953953, 1 month ago

A tuple is declared as T = (2,66,77,55,6,9,55,8) Write the output of print(T.index(55))

Answers

Answered by BrainlyProgrammer
41

First of all we must know what is index()?

What is index()?

  • index() returns the index of the element in the tuple
  • It must be kept in mind that index starts with 0
  • By default, it gives index of first occurrence of the element

Given, T=(2,66,77,55,6,9,55,8)

T.index(55)

So, we will see at what index number does element 55 falls...

elements--->index

2 ---> 0

66 ---> 1

77 ---> 2

55 ---> 3

So here we found 55 which falls at Index number 3

So your output will be: 3

Similar questions