def subset_of_range(range1, range2):
    """ Asks whether range1 is a subset of range2. Returns True or False respectively. """
    if not range1:
        raise ValueError('{} is empty'.format(range1))
    if not range2:
        raise ValueError('{} is empty'.format(range2))
    if len(range1) > 1 and range1.step % range2.step:
        return False
    return range1.start in range2 and range1[-1] in range2
