Python Programming - Lists - Discussion

Discussion Forum : Lists - General Questions (Q.No. 56)
56.
What does the list.index(42) method do in Python?
Finds the index of the first occurrence of 42.
Removes the element with the value 42.
Raises an error because index 42 does not exist.
Finds the index of the last occurrence of 42.
Answer: Option
Explanation:
The index() method in Python lists is used to find the index of the first occurrence of a specific element.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.