kidpawn.py
def _pawn_distance_to_promote(position:int, color:bool):
    """Returns the number of moves this pawn must make before it 
    gets promoted.  Position is an int 0-63, and color is chess.WHITE or chess.BLACK
    """
    assert position in range(64)
    rank = (position // 8) + 1  # 1-8
    if color == chess.WHITE:
        return 8-rank
    else:
        return rank
Returns the number of moves this pawn must make before it 
    gets promoted.  Position is an int 0-63, and color is chess.WHITE or chess.BLACK
    
Returns the number of moves this pawn must make before it
gets promoted.  Position is an int 0-63, and color is chess.WHITE or chess.BLACK
Returns the number of moves this pawn must make before it gets promoted . Position is an int 0 - 63 and color is chess . WHITE or chess . BLACK
def _pawn_distance_to_promote(position:int, color:bool):
    assert position in range(64)
    rank = (position // 8) + 1  
    if color == chess.WHITE:
        return 8-rank
    else:
        return rank
def _pawn_distance_to_promote ( position : int , color : bool ) : assert position in range ( 64 ) rank = ( position // 8 ) + 1 if color == chess . WHITE : return 8 - rank else : return rank
Returns the number of moves this pawn must make before it
gets promoted.
Returns the number of moves this pawn must make before it gets promoted .
"""Returns the number of moves this pawn must make before it 
    gets promoted.  Position is an int 0-63, and color is chess.WHITE or chess.BLACK
    """ # 1-8
position
int
color
bool