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