def list_find_or_append(lst, item):
    """ If item is in the list, return its index. Otherwise, append it to the 
        list and return its index.
        
        Note: may modify the list
    """
    try:
        return lst.index(item)
    except ValueError:
        lst.append(item)
        return len(lst) - 1