def str_to_col_grid_lists(s):
    """

    Convert a string to selected columns and selected grid ranges.

    Parameters:
        s: (str) a string representing one solution.
            For instance, *3**9 means 2 out of 5 dimensions are selected; the second and the last columns are selected,
            and their corresponding grid ranges are 3 and 9. The function will return (1, 4) and (3, 9).

    Return:
        selected_cols (list): list of columns selected as indicated by the string.
        selected_ranges (list): list of grid ranges selected as indicated by the string.

    """

    selected_cols, selected_ranges = [], []

    for i in range(len(s)):
        if s[i] != "*":
            selected_cols.append(i)
            selected_ranges.append(int(s[i]))

    return selected_cols, selected_ranges