input: 
  def play_tic_tac_toe():
      """ Implement a Tic Tac Toe game where the board is represented by a list of 9 spaces.
      Players take turns entering their move (a number from 1 to 9). The game checks for a
      win condition after each move and declares the winner if there is one, or a tie if
      the board is full with no winner.
      >>> main()
      Welcome to Tic Tac Toe!
      |   |   |   |
      |   |   |   |
      |   |   |   |
      <Your turn player 1>
      <Enter your move (1-9): >
      """
  
output:     board = [' '] * 9
      current_player = 'X'
      winner = None
  
      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 board[condition[0]]
          return None
  
      def is_board_full():
          return ' ' not in board
  
      print("Welcome to Tic Tac Toe!")
      print_board()
  
      while True:
          move = int(input(f"<Your turn player {current_player}>\n<Enter your move (1-9): >")) - 1
          if board[move] == ' ':
              board[move] = current_player
              print_board()
              winner = check_winner()
              if winner:
                  print(f"Player {winner} wins!")
                  break
              if is_board_full():
                  print("It's a tie!")
                  break
              current_player = 'O' if current_player == 'X' else 'X'
          else:
              print("Invalid move, try again.")