def indexp(predicate, items):
    """Return the first index into items that satisfies predicate(item)."""
    for i, item in enumerate(items):
        if predicate(item):
            return i

    return -1