def has_horizontal_neighbours(col, row, cell_types):
    left_col = (col - 1)
    right_col = (col + 1)
    if ((left_col >= 0) and (right_col < COLS)):
        return ((grid[(left_col, row)] in cell_types) and (grid[(right_col, row)] in cell_types))
    return False
def has_horizontal_neighbours(col, row, cell_types):
    left_col = (col - 1)
    right_col = (col + 1)
    if ((left_col >= 0) and (right_col < COLS)):
        return ((grid[(left_col, row)] in cell_types) and (grid[(right_col, row)] in cell_types))
    return False