input: Write a function that checks if a player has won in a TicTacToe game. The function should take a 2D list representing the board and a character (`'x'` or `'o'`) representing the player's symbol. The function should return `True` if the player has won, and `False` otherwise.
  def check_win(board, player):
      # check if the player has a row of three
      for row in board:
          if row.count(player) == 3:
              return True
          
      # check if the player 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] == player:
              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] == player:
          return True
      if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == player:
          return True
      return False
  
  assert check_win([['x', 'o', 'x'], ['o', 'x', 'o'], ['x', 'o', 'x']], 'x')==True
  assert check_win([['x', 'o', 'x'], ['o', 'x', 'o'], ['o', 'x', 'o']], 'o')==True
  assert check_win([['x', 'o', 'x'], ['o', 'x', 'o'], ['x', 'o', 'x']], 'o')==False
  assert check_win([['_', '_', '_'], ['_', '_', '_'], ['_', '_', '_']], 'x')==False
  assert check_win([['x', 'x', 'x'], ['o', 'o', '_'], ['_', '_', '_']], 'x')==True
output: def check_win(board, player):
      # check if the player has a row of three
      for row in board:
          if row.count(player) == 3:
              return True
          
      # check if the player 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] == player:
              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] == player:
          return True
      if board[0][2] == board[1][1] and board[1][1] == board[2][0] and board[2][0] == player:
          return True
      return False