in this you will learn techniques for writing programs that manipulate collections like these let' start with simple examplea collection of numbers back in we wrote simple but useful program to compute the mean (averageof set of numbers entered by the user just to refresh your memory (as if you could forget it)here is the program againaverage py def main()sum count xstr input("enter number to quit>"while xstr !"" eval(xstrsum sum count count xstr input("enter number to quit>"print("\nthe average of the numbers is"sum countmain(this program allows the user to enter sequence of numbersbut the program itself does not keep track of what numbers were entered insteadit just keeps summary of the numbers in the form of running sum that' all that' needed to compute the mean suppose we want to extend this program so that it computes not only the meanbut two other standard statistical measures--median and standard deviation --of the data you are probably familiar with the concept of median this is the value that splits the data set into equal-sized parts for the data the median value is since there are two values greater than and two that are smaller one way to calculate the median is to store all the numbers and put them in order so that we can identify the middle value the standard deviation is measure of how spread out the data is relative to the mean if the data is tightly clustered around the meanthen the standard deviation is small when the data is more spread outthe standard deviation is larger the standard deviation provides yardstick for determining how exceptional value is for examplesome teachers define an "aas any score that is at least two standard deviations above the mean the standard deviationsis defined as ssp ( xi ) - in this formula is the meanxi represents the ith data value and is the number of data values the formula looks complicatedbut it is not hard to compute the expression ( xi ) is the square of the "deviationof an individual item from the mean the numerator of the fraction is the sum of the deviations (squaredacross all the data values