Checking rows and columns doesn't work, so I changed some lines a little bit. It works properly now.
# Checking rows
for row in range(0,3):
if (game_array[row][0][2] == game_array[row][1][2] == game_array[row][2][2]) and game_array[row][0][2] != "":
display_message(game_array[row][0][2].upper() + " has won!")
return True
# Checking columns
for col in range(0, 3):
if (game_array[0][col][2] == game_array[1][col][2] == game_array[2][col][2]) and game_array[0][col][2] != "":
display_message(game_array[0][col][2].upper() + " has won!")
return True
Software Developer. Data Science Enthusiastic Currently Pursing masters in Data science from IIIT-Banglore. 4 yrs of experience in Automation and in python. Hardworking guy who believes in his team.
Checking rows and columns doesn't work, so I changed some lines a little bit. It works properly now.
Worked for me. may be version issue. Thanks for your comment.