input: Write a function to implement a basic Tic Tac Toe game in Python. The function should initialize the game board, handle player turns, check for a victory condition, and display the board after each move. The game should continue until a player wins or the board is full, resulting in a tie.
  assert main()=="Welcome to Tic Tac Toe!\n|   |   |   |\n|   |   |   |\n|   |   |   |\n\nYour turn player 1\nEnter your move (1-9): "
output: def main():
      board = [' ' for _ in range(9)]
      current_player = 'X'
      
      def print_board():
          print(f"| {board[0]} | {board[1]} | {board[2]} |")
          print(f"| {board[3]} | {board[4]} | {board[5]} |")
          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 True
          return False
      
      def is_board_full():
          return ' ' not in board
      
      print("Welcome to Tic Tac Toe!")
      print_board()
      
      while True:
          move = input(f"\nYour turn player {current_player}\nEnter your move (1-9): ")
          if move.isdigit() and 1 <= int(move) <= 9 and board[int(move) - 1] == ' ':
              board[int(move) - 1] = current_player
              print_board()
              if check_winner():
                  print(f"Player {current_player} wins!")
                  break
              elif is_board_full():
                  print("It's a tie!")
                  break
              current_player = 'O' if current_player == 'X' else 'X'
          else:
              print("Invalid move, try again.")