Collections in which the elements are ordered are derived from class Sequence. The elements of a sequence can be accessed via subscripting, though the efficiency of this operation varies with the particular kind of sequence. The index function gives the index of an element - for any value v in a list l , l[l.index(v)] == v .
Note that subscripts start an 1, not 0; the index function returns 0 if the element is not in this list.