When you say pair[0]
, that gives you ("a", 1)
. The thing in parentheses is a tuple, which, like a list, is a type of collection. So you can access the first element of that thing by specifying [0]
or [1]
after its name. So all you have to do to get the first element of the first element of pair
is say pair[0][0]
. Or if you want the second element of the third element, it's pair[2][1]
.