input: 
  def tic_tac_toe():
      """This function implements a simple Tic Tac Toe game in Python.
      It initializes a game board, allows two players to take turns, 
      checks for a win or tie condition after each move, and prints the board after each turn.
      
      Example:
      tic_tac_toe()
      """
  
output:     
      board = [[' ' for _ in range(3)] for _ in range(3)]
      current_player = 'X'
  
      def print_board():
          for row in board:
              print('|'.join(row))
              print('-' * 5)
  
      def check_win():
          for row in board:
              if row[0] == row[1] == row[2] != ' ':
                  return True
          for col in range(3):
              if board[0][col] == board[1][col] == board[2][col] != ' ':
                  return True
          if board[0][0] == board[1][1] == board[2][2] != ' ':
              return True
          if board[0][2] == board[1][1] == board[2][0] != ' ':
              return True
          return False
  
      def check_tie():
          for row in board:
              if ' ' in row:
                  return False
          return True
  
      while True:
          print_board()
          row = int(input(f"Player {current_player}, enter row (0, 1, 2): "))
          col = int(input(f"Player {current_player}, enter column (0, 1, 2): "))
          
          if board[row][col] == ' ':
              board[row][col] = current_player
              if check_win():
                  print_board()
                  print(f"Player {current_player} wins!")
                  break
              if check_tie():
                  print_board()
                  print("It's a tie!")
                  break
              current_player = 'O' if current_player == 'X' else 'X'
          else:
              print("Cell already taken, try again.")
  