From 4036123a2e696603673f1a0af00c9176a56f8f44 Mon Sep 17 00:00:00 2001 From: Nischay mrzn <129774293+Nischaymrzn@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:05:25 +0545 Subject: [PATCH] Create tic_tac_toe.py --- Python/tic_tac_toe.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Python/tic_tac_toe.py diff --git a/Python/tic_tac_toe.py b/Python/tic_tac_toe.py new file mode 100644 index 0000000..35faefb --- /dev/null +++ b/Python/tic_tac_toe.py @@ -0,0 +1,5 @@ +def tic_tac_toe(board): + for row in board: + if row.count(row[0]) == 3 and row[0] != ' ': + return f"{row[0]} wins!" + return "No winner!"