looking for bug in numpy code
So, I'm working on a SL learn exercise about Numpy functions, and I'm having some trouble. The exercise only wants a simple percentage of values that are within one standard deviation of the mean. I thought I'd provided that, but the hidden test case keeps showing up as a failure. I've tried converting the percent to an integer, and not converting it, and both times it comes up wrong. I ended up writing all this other code around the problem to see if I could find something wrong in one of the other values, but everything looks ok to me. Since they are all outputs from numpy functions and not from anything I've written myself, I'm not really sure how I could fix them anyway. Can anyone looking at this see any problems with the outputs? FYI, in the actual problem, of course all the print statements are commented out, except for the last one, which prints the percentage. Anyway, the code is below, and the code playground window is at: https://code.sololearn.com/ceSbl3xGUctY import numpy as np data = np.array( [150000, 125000, 320000, 540000, 200000, 120000, 160000, 230000, 280000, 290000, 300000, 500000, 420000, 100000, 150000, 280000]) print(np.sort(data)) print("=================") print("Lowest value: " + str(np.min(data))) print("Mean: " + str(np.mean(data))) print("Highest value: " + str(np.max(data))) print("=================") print("Variance: " + str(np.var(data))) print("SD: " + str(np.std(data))) lowerRange = np.mean(data) - np.std(data) upperRange = np.mean(data) + np.std(data) print("Lower range: " + str(lowerRange)) print("Upper range: " + str(upperRange)) withinSD = 0 for n in data: if n >= lowerRange and n <= upperRange: withinSD += 1 percentWithinSD = int((withinSD/data.size)*100) print("==================") print("# of data points: " + str(data.size)) print("#WithinSD: " + str(withinSD)) print("%WithinSD: " + str(percentWithinSD))