human
Finding the index of an item given a list containing it in Python
assistant
Here is some code to finding the index of an item 'foo' given a list `['foo', 'bar', 'baz']` containing it

[i for i, j in enumerate(['foo', 'bar', 'baz']) if j == 'foo']

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.