def first(seq, pred=None):
    """Return the first item in seq for which the predicate is true.
    
    If the predicate is None, return the first item regardless of value.

    If no items satisfy the predicate, return None.
    """
    if pred is None:
        pred = lambda x: True
    for item in seq:
        if pred(item):
            return item
    return None
Return the first item in seq for which the predicate is true.
    
    If the predicate is None, return the first item regardless of value.

    If no items satisfy the predicate, return None.
    
recipes/Python/438810_First_last_item_access_predicates_increase/recipe-438810.py