input: Write a function to implement a Tic Tac Toe game in Python. The function should handle player turns, check for victory conditions, and determine if the game results in a tie. If a player wins or the game ends in a tie, the function should print the corresponding message and terminate the game. The board is represented by a list of 9 elements, each initially set to a space character, and players make moves by entering a number from 1 to 9 to place their icon ("X" or "O") on the board.
  assert main()==None
  assert main()==None
  assert main()==None
  assert main()==None
  assert main()==None
output: def main():
      board = [' ' for _ in range(9)]
      current_player = 'X'
      
      def print_board():
          print(f"{board[0]}|{board[1]}|{board[2]}")
          print("-+-+-")
          print(f"{board[3]}|{board[4]}|{board[5]}")
          print("-+-+-")
          print(f"{board[6]}|{board[7]}|{board[8]}")
      
      def check_winner():
          win_conditions = [(0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)]
          for condition in win_conditions:
              if board[condition[0]] == board[condition[1]] == board[condition[2]] != ' ':
                  return board[condition[0]]
          return None
      
      def is_board_full():
          return ' ' not in board
      
      while True:
          print_board()
          move = int(input(f"Player {current_player}, enter your move (1-9): ")) - 1
          
          if board[move] == ' ':
              board[move] = current_player
              winner = check_winner()
              if winner:
                  print_board()
                  print(f"Player {winner} wins!")
                  return
              if is_board_full():
                  print_board()
                  print("It's a tie!")
                  return
              current_player = 'O' if current_player == 'X' else 'X'
          else:
              print("Invalid move, try again.")