def first(func, iter):
    """Find the first item in an iterable for which func(item) is True.
    If not item is find None is returned."""
    for i in iter:
        if func(i):
            return i
    else:
        return None
