Do I divide the total variance by the number of scores inside the loop?
Answer
The step asking you to divide the total variance by the number of scores should be done outside of the for loop, otherwise your number will be far smaller than it should be because you divide it at each step.
Calculating a variance involves squaring the distance from the average of each score, summing those up, and then, after all that, dividing the summed variance by the number of scores.
In pseudo code, the process looks like this:
set variance to 0
for each score:
variance = (distance of score from average) squared
return variance / number of scores
And be sure to print the result of calling your function at the end!
In the āprint_gradesā function, when you print out all grades one by one, how do you remove the āNoneā that is being displayed at the end after all scores have been printed out?
Yes, got rid of it! Thanks @mtf!
I didnāt realize that in cases where we use print inside of a function where we donāt have to use return, we should not use the āprintā statement for calling the function. Got it now, thanks!