def play(self, n, piece=None):
        """
        Place piece at spot numbered n and ammend attributes.
        if piece is None, remove the piece at cell n and ammend attributes.
        """
        x, y = self._num_to_coord[n]
        if piece:
            self.board[y][x] = piece
            (self.xnums if piece == 'X' else self.onums).add(n)
            self.avail.remove(n)
        else:
            self.board[y][x] = '_'
            self.avail.add(n)
            (self.xnums if n in self.xnums else self.onums).remove(n)

        Place piece at spot numbered n and ammend attributes.
        if piece is None, remove the piece at cell n and ammend attributes.
        
recipes/Python/578563_Tic_Tac_Toe_console_game/recipe-578563.py