Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 3
Why does not work? -Basketball Players Project
I thought it should work but why it doesnt? From data science course first project players = [180, 172, 178, 185, 190, 195, 192, 200, 210, 190] # ekhtelaf beine har do ta #mean = average mean = 0 for i in range(len(players)): mean += players[i] mean /= len(players) print (mean) # average of sqared differ from the mean ekhtelaf = list() x = 0 for i in range(len(players)): x = mean - players [i] x = x ** 2 ekhtelaf.append(x) #sum_ekhtelaf sum = 0 for adad in ekhtelaf: sum += adad #output var = sum / len(players) std = var ** (1/2) print(int(std))
1 Resposta
+ 4
Try it in this way
import statistics
players = [180, 172, 178, 185, 190, 195, 192, 200, 210, 190]
mean = statistics .mean(players)
count = 0
for player in players:
if player > mean:
count += 1
print (count)