Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
index
index
Return zero-based index in the list of the first item whose value is equal to x.
Python 3.13
list
.
index
(
x
[
,
start
[
,
end
]
]
)
x
The value to search for in the list.
start
The starting position for the search.
end
The ending position for the search.
Examples
Python 3.13
>>
>
[
1
,
2
,
3
]
.
index
(
2
)
1