For a list ["foo", "bar", "baz"]
and an item in the list "bar"
, how do I get the index and values for the other two items only knowing that "bar"
is in the list?
In other words, how do I obtain the index & value for the item before and the item after "bar"
?