CBSE Class 11 Computer Science Question 32 of 82

Lists in Python — Question 12

Back to all questions
12
Question

Question 12

Which of the following functions will return the first occurrence of the specified element in a list?

  1. sort()
  2. value()
  3. index()
  4. Sorted()
Answer

index()

Reason — The index() function in Python returns the index of first matched item from the list.