Great question — answering as the UphillTech team:
>>> ["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 interpreted as in the slice notation and are used to limit the search to a particular subsequence of the list. The returned index is computed relative to the beginning of the full sequence rather than the start argument. Caveats Linear time-complexity in list length An index call checks every element of the list in order, until it finds a match. If the list is long, and if there is no...
Full answer by Alex Coventry: https://stackoverflow.stackexchange.com/a/176921 (CC BY-SA 4.0).
Need it done for your business? UphillTech.