For example, if I have a list like [“foo”, “bar”, “baz”] and I want to get the index of “bar” (which is 1), what’s the correct way to do this? I’m looking for a simple and reliable method for python find index of item in list operations.
For example, if I have a list like [“foo”, “bar”, “baz”] and I want to get the index of “bar” (which is 1), what’s the correct way to do this? I’m looking for a simple and reliable method for python find index of item in list operations.