def placeShipH(row: int, col: int, lg: int, grid: list, symbol: str) -> bool:
    """
    Place the ship horizontally if possible.

    Parameters
    ----------
    row : int
        Row number.
    col : int
        Column number.
    lg : int
        Number of cells occupied by the ship that is tried to be placed.
    grid : list
        Battleship grid.
    symbol : str
        Character that represents the ship.

    Returns
    -------
    bool
        True if the ship is placed, False otherwise.

    """
    shipInPlace = True
    if col+lg>10:
            shipInPlace = False
    else:
        for count in range(lg):
            if grid[row][col+count]!="E":
                shipInPlace = False
    if shipInPlace:
        for count in range(lg):
            grid[row][col+count] = symbol
    return shipInPlace