def within_range(val, vrange):
    """ Check if a value is within a range.

    **Parameters**\n
    val: numeric
        Value to check within range.
    vrange: tuple/list
        Range of values.
    """
    
    if (val >= vrange[0] and val <= vrange[-1]) or (val <= vrange[0] and val >= vrange[-1]):
        return True
    else:
        return False