From 4c3f1c72850de44c786cec564333e9f20ccc741d Mon Sep 17 00:00:00 2001 From: prezha Date: Sun, 3 Jul 2016 15:28:32 +0200 Subject: [PATCH] Update Milestone Project 1 - Advanced Solution.ipynb ask_player function should also check if the entered int is within allowed 1..9 range --- Milestone Project 1 - Advanced Solution.ipynb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Milestone Project 1 - Advanced Solution.ipynb b/Milestone Project 1 - Advanced Solution.ipynb index 0af4d2f..368f141 100644 --- a/Milestone Project 1 - Advanced Solution.ipynb +++ b/Milestone Project 1 - Advanced Solution.ipynb @@ -163,6 +163,10 @@ " print(\"Sorry, please input a number between 1-9.\")\n", " continue\n", "\n", + " if choice not in range(1,10):\n", + " print(\"Sorry, please input a number between 1-9.\")\n", + " continue\n", + "\n", " if board[choice] == \" \":\n", " board[choice] = mark\n", " break\n",