I've tried quite a few solutions so my program is a bit jumbled, but I still can't figure out a way to check for "_" and end the game if there are none left. I'd actually rather have them break the moment the board fills, but so far nothing seems to work and I don't understand anymore. Here is my program: grid = [['0','1','2','3'],['1','_','_','_'], ['2','_','_','_'],['3','_','_','_']] print("Tic-Tac-Toe") for row in grid: print(row) for row in grid: for cell in row: if cell != '_': valid_input = False while not valid_input: x_x = int(input("Choose x-coordinate for x: ")) x_y = int(input("Choose y-coordinate for x: ")) if x_x < 1 or x_x > 3 or x_y < 1 or x_y > 3: print("Invalid input for x. Please try again.") elif grid[x_x][x_y] != '_': if '_' in grid == False: break else: print("The place is occupied. Choose another place for x.") else: grid[x_x][x_y] = 'x' for row in grid: print(row) valid_input = True valid_input = False while not valid_input: o_x = int(input("Choose x-coordinate for o: ")) o_y = int(input("Choose y-coordinate for o: ")) if o_x < 1 or o_x > 3 or o_y < 1 or o_y > 3: print("Invalid input for o. Please try again.") elif grid[o_x][o_y] != '_': if '_' in grid == False: break else: print("The place is occupied. Choose another place for o.") else: grid[o_x][o_y] = 'o' for row in grid: print(row) valid_input = True I thought this would require you to still try another turn after the game is "done", but then break out of the whole loop. It doesn't. It asks me for another "o" spot indefinitely. Continue reading...