import random


def random_randrange(test_list):
    """Solution to exercise R-1.12.

    Python’s random module includes a function choice(data) that returns a
    random element from a non-empty sequence. The random module in-
    cludes a more basic function randrange, with parameterization similar to
    the built-in range function, that return a random choice from the given
    range. Using only the randrange function, implement your own version
    of the choice function.
    """
    idx = random.randrange(0, len(test_list))
    return test_list[idx]