Given a list like the one below, I want to be able to check what the second element of the nested list is given the first element of the nested list. (There would be no repeated elements of the same index in different nested lists - meaning: there wouldn't be "apple" as the 1st element of more than one nested list) For example: I want to get the result "peach" knowing that "orange" is the 1st element of the nested list, but NOT knowing that ["orange", "peach"] is the second element of list Example.
Example = [["apple", "banana"], ["orange", "peach"], ["strawberry", "blueberry"]]
I've tried using the
.index() function but it only works for a whole element of the list (which in this case would be
["orange", "peach"] - it tells me that "orange" isn't an element of the list if I try