get index of item based on value in list python code example Example: python find index by value >>> ["foo", "bar", "baz"].index("bar") 1