def delete_before(list, key):
    """
    Return a list with the the item before the first occurrence of the
    key (if any) deleted.
    """
    if list == ():
        return ()
    else:
        head1, tail1 = list
        if tail1 == ():
            return list
        else:
            head2, tail2 = tail1
            if head2 == key:
                return tail1
            else:
                return (head1, delete_before(tail1, key))