0
I need help on this question in python, I don't seem to get it right
The given code includes a list of heights for various basketball players. You need to calculate and output how many players are in the range of one standard deviation from the mean.
5 Answers
+ 2
attempt please
+ 1
Show your attempt
+ 1
import statistics
import math
players = [180, 172, 178, 185, 190, 195, 192, 200, 210, 190]
avg = round(statistics.mean(players), 2)
std = round(statistics.stdev(players), 2)
count = 0
for n in range(len(players)):
if math.isclose(players[n], avg, abs_tol=std):
count = count + 1
print(count)
0
ravilnicki thanks a lot, that's better, I will try using numpy,