def RANGE(start, stop=None, increment=None):
    """
    Variation on range() that increments/decrements
    based on variable sign. Auto-sort feature means there
    is no wrong way to enter the first two values.

    Default increment is 1.

    Increment of -1 includes end value:
        RANGE(10, increment=-1) will produce 11 values, ending at zero
        RANGE(10, 1, -1) will produce 10 values, ending at 1.
    """
    if stop is None:
        stop = start
        start = 0
    if increment is None:
        increment = 1
    value_list = sorted([start, stop])
    if increment == 0:
        print('Error! Please enter nonzero increment value!')
    else:
        value_list = sorted([start, stop])
        if increment < 0:
            start = value_list[1]
            stop = value_list[0]
            while start >= stop:
                worker = start
                start += increment
                yield worker
        else:
            start = value_list[0]
            stop = value_list[1]
            while start < stop:
                worker = start
                start += increment
                yield worker
