def between(min, max):
    """
    Returns a function to test if a value lies between min and max
    """

    def op(x):
        if min < x and x < max:
            return True
        print("ERROR: Value must be between {} and {}".format(min, max))
        return False

    return op