to change elif check_win(self.markers, False): and self.markers[int(x) + int(y) * 3] = player_marker(True) this issue can't allow to win by computer