diff --git a/examples/python/hidato_table.py b/examples/python/hidato_table.py index ebc617d51e..19c5616ac8 100644 --- a/examples/python/hidato_table.py +++ b/examples/python/hidato_table.py @@ -168,10 +168,10 @@ def Solve(model): solver.EndSearch() - print('num_solutions:', num_solutions) - print('failures:', solver.Failures()) - print('branches:', solver.Branches()) - print('wall time:', solver.WallTime()) + print('num_solutions: %i' % num_solutions) + print('failures: %i' % solver.Failures()) + print('branches: %i' % solver.Branches()) + print('wall time:%i' % solver.WallTime()) def PrintOneSolution(positions, rows, cols, num_solution): diff --git a/examples/python/knapsack.py b/examples/python/knapsack.py index 929be3ddf1..546654373a 100644 --- a/examples/python/knapsack.py +++ b/examples/python/knapsack.py @@ -46,7 +46,7 @@ def main(unused_argv): solver.Init(profits, weights, capacities) computed_profit = solver.Solve() - print('optimal profit = ' + str(computed_profit) + '/' + str(optimal_profit)) + print('optimal profit = %i/%i' % (computed_profit, optimal_profit)) if __name__ == '__main__': diff --git a/examples/python/tsp.py b/examples/python/tsp.py index ad2c74b0a6..b288516439 100644 --- a/examples/python/tsp.py +++ b/examples/python/tsp.py @@ -107,7 +107,7 @@ def main(_): from_node = rand.randrange(FLAGS.tsp_size - 1) to_node = rand.randrange(FLAGS.tsp_size - 1) + 1 if routing.NextVar(from_node).Contains(to_node): - print('Forbidding connection ' + str(from_node) + ' -> ' + str(to_node)) + print('Forbidding connection %i -> %i' % (from_node, to_node)) routing.NextVar(from_node).RemoveValue(to_node) forbidden_connections += 1