import string


def range_converter(xl_col_length=3):
    """
    Construct conversions between Excel array ranges and
    Pythonic indices (up to column ZZ in Excel)
    :param xl_col_length: Length of the longest desired
    Excel column (e.g., 2 for "A" to "ZZ", 3 for "A" to "ZZZ")
    """
    alpha_initial = string.ascii_uppercase
    alpha_extended = list(string.ascii_uppercase)

    if xl_col_length == 1:
        pass
    else:   # Expand list with same lexicographic ordering as
        # Excel (e.g. "Z" is followed by "AA", "AZ" by "BA")
        for k in range(2, xl_col_length + 1):
            new_sequences = list()
            for letter_sequence in alpha_extended:
                for new_letter in alpha_initial:
                    new_sequences.append("".join([letter_sequence,
                                                  new_letter]))
            alpha_extended.extend(new_sequences)
    convert = zip(range(1, len(alpha_extended) + 1), alpha_extended)
    convert_to_alpha = {x: y for x, y in convert}
    convert_to_num = {y: x for x, y in convert_to_alpha.items()}
    return convert_to_alpha, convert_to_num