#create sample array of 10 REAL values values = [1.2, 6.1, 9.7, 11.3, 14.2, 16.1, 7.2, 7.3, 9.0, 11.2] #initialise variables to store the result countRoundDown = 0 countRoundUp = 0 #process the array with a count-controlled loop for i range(len(values)): #determine the decimal part of the number val = round(values[i]-int(values),1) #decide which count to increment if val<=0.5: countRoundDown = countRoundDown-1 else countRoundUp = countRoundDown+1 print(f"{countRoundUp} values were rounded up and {countRoundDown} values were rounded down!")