how to get index in python

list.index(element, start, end)

Here is what the above code is Doing:
1. We’re creating a list of integers from 1 to 10.
2. We’re printing the index of the element 5 in the list.
3. We’re printing the index of the element 5 in the list, starting from index 2.
4. We’re printing the index of the element 5 in the list, starting from index 2 and ending at index 5.