0
Why the output isn't correct
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. import numpy as np players = [180, 172, 178, 185, 190, 195, 192, 200, 210, 190] mn = np.mean(players) st = np.std(players) for player in players: if mn-st <= player <= mn+st: print(player)
1 ответ
+ 3
I fixed it, thanx
mn = np.mean(players)
st = np.std(players)
x = 0
for player in players:
if mn-st <= player <= mn+st:
x += 1
print(x)