diff --git a/content/en/docs/languages/python/getting-started.md b/content/en/docs/languages/python/getting-started.md index 1fd4e6917c8a..c517018138d5 100644 --- a/content/en/docs/languages/python/getting-started.md +++ b/content/en/docs/languages/python/getting-started.md @@ -58,16 +58,18 @@ app = Flask(__name__) logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) + @app.route("/rolldice") def roll_dice(): - player = request.args.get('player', default = None, type = str) + player = request.args.get('player', default=None, type=str) result = str(roll()) if player: - logger.warn("%s is rolling the dice: %s", player, result) + logger.warning("%s is rolling the dice: %s", player, result) else: - logger.warn("Anonymous player is rolling the dice: %s", result) + logger.warning("Anonymous player is rolling the dice: %s", result) return result + def roll(): return randint(1, 6) ```