def delete_all(list, key):
    """Return a list with all occurrences of the given key deleted."""
    if list == ():
        return ()
    else:
        head, tail = list
        if head == key:
            return delete_all(tail, key)
        else:
            return (head, delete_all(tail, key))