solution.py
def eliminate(values, peers, maj_dia, min_dia, boxes, rows, cols):
    """Eliminate values from peers of each box with a single value.

    Go through all the boxes, and whenever there is a box with a single value,
    eliminate this value from the set of values of all its peers. For diagonal
    elements, check for diagonal peers and eliminate.

    Args:
        values: Sudoku in dictionary form.
    Returns:
        Resulting Sudoku in dictionary form after eliminating values.
    """

    solved_boxes = [key for key in values.keys() if len(values[key]) == 1]
    for box in solved_boxes:
        val = values[box]
        ##print("Box:", box, "Peers:", peers[box])
        for peer in peers[box]:
            #if peer == 'A5':
                ##print("_____________________________________________________")
                ##print("_____________________________________________________")
            values = assign_value(values, peer, values[peer].replace(val,""))
            #Major Diagonal Peer elimination
        
        if box in maj_dia[0]:
                ###print(key,":", values[key], "key:value in Major Diagonal")
            for peer in maj_dia[0]:
                if peer != box:
                    values = assign_value(values, peer, values[peer].replace(val,""))

        elif box in min_dia[0]:
            #Minor Diagonal Peer elimination
            for peer in min_dia[0]:
                if peer != box:
                    values = assign_value(values, peer, values[peer].replace(val,""))
        else:
            pass

    return values
Eliminate values from peers of each box with a single value.

    Go through all the boxes, and whenever there is a box with a single value,
    eliminate this value from the set of values of all its peers. For diagonal
    elements, check for diagonal peers and eliminate.

    Args:
        values: Sudoku in dictionary form.
    Returns:
        Resulting Sudoku in dictionary form after eliminating values.
    
Eliminate values from peers of each box with a single value.
Go through all the boxes, and whenever there is a box with a single value,
eliminate this value from the set of values of all its peers. For diagonal
elements, check for diagonal peers and eliminate.
Eliminate values from peers of each box with a single value . Go through all the boxes and whenever there is a box with a single value eliminate this value from the set of values of all its peers . For diagonal elements check for diagonal peers and eliminate .
def eliminate(values, peers, maj_dia, min_dia, boxes, rows, cols):
    solved_boxes = [key for key in values.keys() if len(values[key]) == 1]
    for box in solved_boxes:
        val = values[box]
        for peer in peers[box]:
            values = assign_value(values, peer, values[peer].replace(val,""))
        if box in maj_dia[0]:
            for peer in maj_dia[0]:
                if peer != box:
                    values = assign_value(values, peer, values[peer].replace(val,""))
        elif box in min_dia[0]:
            for peer in min_dia[0]:
                if peer != box:
                    values = assign_value(values, peer, values[peer].replace(val,""))
        else:
            pass
    return values
def eliminate ( values , peers , maj_dia , min_dia , boxes , rows , cols ) : solved_boxes = [ key for key in values . keys ( ) if len ( values [ key ] ) == 1 ] for box in solved_boxes : val = values [ box ] for peer in peers [ box ] : values = assign_value ( values , peer , values [ peer ] . replace ( val , "" ) ) if box in maj_dia [ 0 ] : for peer in maj_dia [ 0 ] : if peer != box : values = assign_value ( values , peer , values [ peer ] . replace ( val , "" ) ) elif box in min_dia [ 0 ] : for peer in min_dia [ 0 ] : if peer != box : values = assign_value ( values , peer , values [ peer ] . replace ( val , "" ) ) else : pass return values
Eliminate values from peers of each box with a single value.
Eliminate values from peers of each box with a single value .
"""Eliminate values from peers of each box with a single value.

    Go through all the boxes, and whenever there is a box with a single value,
    eliminate this value from the set of values of all its peers. For diagonal
    elements, check for diagonal peers and eliminate.

    Args:
        values: Sudoku in dictionary form.
    Returns:
        Resulting Sudoku in dictionary form after eliminating values.
    """ ##print("Box:", box, "Peers:", peers[box])
 #if peer == 'A5':
 ##print("_____________________________________________________")
 ##print("_____________________________________________________")
 #Major Diagonal Peer elimination
 ###print(key,":", values[key], "key:value in Major Diagonal")
 #Minor Diagonal Peer elimination

Resulting Sudoku in dictionary form after eliminating values.
Resulting Sudoku in dictionary form after eliminating values .
values
Sudoku in dictionary form.
Sudoku in dictionary form .
peers
maj_dia
min_dia
boxes
rows
cols