input: Write a function to implement a TicTacToe game in Python. The function should include methods to initialize the game, display the current board, and check for a winning condition. The function should handle game initialization with an empty 3x3 board and alternate turns between players 'x' and 'o'. It should check if the current player has won by getting three in a row horizontally, vertically, or diagonally.
  
  class TicTacToe:
  
  def __init__(self):
      self.board = [['_' for _ in range(3)] for _ in range(3)]
      self.turn = 'x'
      
  def display(self):
      for row in self.board:
          print(' '.join(row))
  
  def check_win(self):
      board = self.board
  
      # check if the player with the current turn has a row of three
      for row in self.board:
          if row.count(self.turn) == 3:
              return True
          
      # check if the player with the current turn has a column of three
      for col in range(3):
          if board[0][col] == board[1][col] and board[1][col] == board[2][col] and board[2][col] == self.turn:
              return True
          
      # check for the two diagonals
      if board[0][0] == board[1][1] and board[1][1] == board[2][2] and board[2][2] == self.turn:
          return True
      if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == self.turn:
          return True
      return False
  
  # Example test cases
  game = TicTacToe()
  assert game.check_win() == False  # No win at start
  game.board = [['x', 'x', 'x'], ['_', '_', '_'], ['_', '_', '_']]
  assert game.check_win() == True  # Horizontal win by 'x'
  game.board = [['x', '_', '_'], ['x', '_', '_'], ['x', '_', '_']]
  assert game.check_win() == True  # Vertical win by 'x'
  game.board = [['_', '_', 'o'], ['_', 'o', '_'], ['o', '_', '_']]
  game.turn = 'o'
  assert game.check_win() == True  # Diagonal win by 'o'
  game.board = [['x', 'o', 'x'], ['o', 'x', 'o'], ['o', 'x', 'o']]
  assert game.check_win() == False  # No win with full board
output: def __init__(self):
      self.board = [['_' for _ in range(3)] for _ in range(3)]
      self.turn = 'x'
      
  def display(self):
      for row in self.board:
          print(' '.join(row))
  
  def check_win(self):
      board = self.board
  
      # check if the player with the current turn has a row of three
      for row in self.board:
          if row.count(self.turn) == 3:
              return True
          
      # check if the player with the current turn has a column of three
      for col in range(3):
          if board[0][col] == board[1][col] and board[1][col] == board[2][col] and board[2][col] == self.turn:
              return True
          
      # check for the two diagonals
      if board[0][0] == board[1][1] and board[1][1] == board[2][2] and board[2][2] == self.turn:
          return True
      if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == self.turn:
          return True
      return False