# Arup Guha
# 11/2/2020
# Solution to COP 2930 Program #8 Part B: valsInRange Function

# Returns the number of items in vals that are in between low and high,
# inclusive.
def valsInRange(vals,low,high):

    # Accumulator
    cnt = 0

    # Loop through values.
    for x in vals:

        # This are the ones we want to count.
        if x >= low and x <= high:
            cnt += 1

    # Return the # of values...
    return cnt

# Our tests.
def testValsInRange():
    print(valsInRange([3,12,6,5,2,8,9], 4, 9))
    print(valsInRange([100, 99, 98, 97], 0, 100))
    print(valsInRange([30,40,50,55,59,20], 60, 100))
    print(valsInRange([36,16,25,24,36,23,23,20,32], 23,35))

# Run it.
testValsInRange()
