def first_index(L, value):
    """
    Find the first occurrence of value in L.
    """
    val = next(iter(filter(lambda x: x[1] == value, enumerate(L))))

    if val:
        return(val[0])
    else:
        raise(ValueError("{} is not in the list.".format(value)))