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.

9th Feb 2022, 8:06 PM
Caleb Namondwe
Caleb Namondwe - avatar
5 Answers
+ 2
attempt please
9th Feb 2022, 8:09 PM
Kamil Hamid
Kamil Hamid - avatar
+ 1
Show your attempt
9th Feb 2022, 8:13 PM
MATOVU CALEB
MATOVU CALEB - avatar
+ 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)
9th Feb 2022, 8:36 PM
Caleb Namondwe
Caleb Namondwe - avatar
0
ravilnicki thanks a lot, that's better, I will try using numpy,
10th Feb 2022, 6:01 AM
Caleb Namondwe
Caleb Namondwe - avatar