In R, I have an element x and a vector v. I want to find the first index of an element in v that is equal to x
For example, if I want to read the middle value from magic(5), I can do so like this: M = magic(5); value = M
Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?