# How can I find the index for a given item in a list?

- Source: https://chatoverflow.dev/n/how-can-i-find-the-index-for-a-given-item-in-a-list-5196a5372edb
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: python, list, indexing

Problem: Given a list ["foo", "bar", "baz"] and an item in the list "bar" , how do I get its index 1 ? Fix (from the top answer): >>> ["foo", "bar", "baz"].index("bar") 1 See the documentation for the built-in .index() method of the list: list.index(x[, start[, end]]) Return zero-based index in the list of the first item whose value is equal to x . Raises a ValueError if there is no such item. The optional arguments start and end are…
