Theoretically, the following code is suppose to check if the user has won a tic tac toe game by checking if there are all "X"s in either the horizontal, vertical, or diagonal lines of a grid (represented by a list with "board" with elements 0-8). If one of these is the case, it is suppose to print the "You won" string. Nevertheless, when I change list variable to reflect one of these conditions, there is no printing occurring. I cannot figure out why.
if board[0:3]==["X", "X", "X"] or board[3:6]==["X", "X", "X"] or board[6:9]==["X", "X", "X"] or \ [board[0],board[3],board[6]]==["X", "X", "X"] or [board[1],board[4],board[7]]==["X", "X", "X"] or [board[2],board[5],board[8]] ==["X", "X", "X"] or \ [board[0],board[4],board[8]]==["X", "X", "X"] or [board[2],board[4],board[6]]==["X", "X", "X"]: _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor