From 48b6e86c800191697e605450ae68faad737b00ac Mon Sep 17 00:00:00 2001 From: Sayed Navid Date: Sun, 21 Dec 2025 17:47:48 +0430 Subject: [PATCH 1/2] some tutorials made --- .idea/copilot.data.migration.agent.xml | 6 ++++++ .venv/tutorial.py | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .idea/copilot.data.migration.agent.xml diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml new file mode 100644 index 0000000..4ea72a9 --- /dev/null +++ b/.idea/copilot.data.migration.agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.venv/tutorial.py b/.venv/tutorial.py index 0a7ba23..5da1fe1 100644 --- a/.venv/tutorial.py +++ b/.venv/tutorial.py @@ -3,6 +3,14 @@ [0, 0, 0], [0, 0, 0] ] -print(' a b c') -for count, row in enumerate(game): - print(count, row) + + +def game_board(player=0, row=0, column=0, just_display=False): + if not just_display: + game[row][column] = player + print(' a b c') + for count, row in enumerate(game): + print(count, row) + + +game_board(player=1, row=1, column=1) From f69fe9a1502d44d8d61cf2c50e041373e19b8814 Mon Sep 17 00:00:00 2001 From: Sayed Navid Date: Sun, 21 Dec 2025 17:53:40 +0430 Subject: [PATCH 2/2] the error handling done --- .venv/tutorial.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.venv/tutorial.py b/.venv/tutorial.py index 5da1fe1..ebc1a6b 100644 --- a/.venv/tutorial.py +++ b/.venv/tutorial.py @@ -6,11 +6,14 @@ def game_board(player=0, row=0, column=0, just_display=False): - if not just_display: - game[row][column] = player - print(' a b c') - for count, row in enumerate(game): - print(count, row) + try: + if not just_display: + game[row][column] = player + print(' a b c') + for count, row in enumerate(game): + print(count, row) + except IndexError as e: + print('some error occured:', e) -game_board(player=1, row=1, column=1) +game_board(player=1, row=5, column=1)