python find list element by value code example
Example 1: how to find item in list python without indexnig
>>> ["foo", "bar", "baz"].index("bar")
1
Example 2: python index of item in list
list.index(element)
Example 3: python search list by value
[1,2,3].index(2) # => 1
[1,2,3].index(4) # => ValueError