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