import random


def random_range(max):
    """
    A range from 0 to a randomly chosen end between 1 and `max`. The smallest range would thus be `range(0, 1)` while
    the largest would be `range(0, max)`.
    """
    assert max >= 1, f"max {max} must be greater than or equal to 1"

    return range(0, random.randint(1, max))