def get_item(lst, i):
    """Iteratively traverse a linkedlist to access the item at index i
    """
    assert(i >= 0 and int(i) == i)
    while i > 0:
        lst = lst.rest
        i -= 1
    return lst.first