0
Variance can't go ahead with a intern challange
Hi, I need help with this challange. Whit this values i have to use Python code to calculate variance the result using the corresponding equation. I think my code is correct but sololearn no... what do you think? Thanks!! valores = [0, 8, 8, 9] media = (0 + 8 + 8 + 9 )/20 total = 0 for valor in valores: total += (valor - media)**2 c = total / media print (c)
1 Answer
+ 4
In the last step you are dividing by the mean, but you should divide by the number of elements (in this case 4)