Given a list [\"foo\", \"bar\", \"baz\"] and an item in the list \"bar\", how do I get its index (1) in Python?
[\"foo\", \"bar\", \"baz\"]
\"bar\"
1
Finding index of item x in list L:
idx = L.index(x) if (x in L) else -1