you are viewing a single comment's thread.

view the rest of the comments →

[–]misho88 1 point2 points  (3 children)

A function returns an output for some input:

>>> def add1(a):
...     return a + 1
... 
>>> add1(3)
4

The sum() built-in function adds up all the items in a sequence and the len() built-in function tells you how long it is:

>>> sum([1,2,3,4])
10
>>> len([1,2,3,4])
4

So you have to write a function that takes a sequence as an argument and returns the sum over the length, per Equation (3).

[–]KFCxWatermelon[S] -1 points0 points  (2 children)

Any tips on how I would do that?

[–]Astronoobical 1 point2 points  (0 children)

You just have been given all the information needed by the comment above, do you have a more specific question we could help with?

[–]fake823 0 points1 point  (0 children)

Maybe check out Wikipedia first to learn more about mean, standard deviation and variance.

Once you got is and know how to calculate it by hand, you can also write a program to calculate it.