def has_vertical_neighbours(col, row, cell_types):
    above_row = (row - 1)
    below_row = (row + 1)
    if ((above_row >= 0) and (below_row < ROWS)):
        return ((grid[(col, above_row)] in cell_types) and (grid[(col, below_row)] in cell_types))
    return False
def has_vertical_neighbours(col, row, cell_types):
    above_row = (row - 1)
    below_row = (row + 1)
    if ((above_row >= 0) and (below_row < ROWS)):
        return ((grid[(col, above_row)] in cell_types) and (grid[(col, below_row)] in cell_types))
    return False