1. Engineering
  2. Computer Science
  3. having trouble with the last function and test question using...

Question: having trouble with the last function and test question using...

Question details

Having trouble with the last function and test question. Using Python 3, you are asked to write a program with 4 functions and a test for these functions. The first function readList() reads from the keyboard a list of numbers. The numbers entered after being prompted, can be real numbers or integers separated by a space. The user is prompted by a message “Enter a set of numbers (separated by space):”. Once the numbers are entered, the function returns a list with these numbers sorted from the smallest to the largest. The second function calculateMean() receives a list of numbers and calculates. The mean is then returned as a float. The third function calculateStandarDev() receives a list of numbers and calculates the standard deviation. This standard deviation is returned as a float. The fourth function outlier() receives a list of numbers and returns a list of outliers from that initial list of numbers. An outlier is a number that is more than 3 standard deviations away from the Mean of the set of numbers. That is a number that is either bigger or smaller than the Mean by 3 times the standard deviation. Once you write these functions, you can test them separately. Then write a program that asks a user to enter a list of numbers, displays the list sorted, the mean and the standard deviation as well as the list of outliers (if any) for that entered list. You should be able to enter numbers with a decimal point. The program should ask you whether you want to enter another set of data or quit. Here is an example of output:Lab exercise for Week 4: You are asked to write a program with 4 functions and a test for these functions The first function readList) reads from the keyboard a list of numbers. The numbers entered after being prompted, can be real numbers or integers separated by a space. The user is prompted by a message Enter a set of numbers (separated by space): Once the numbers are entered, the function returns a list with these numbers sorted from the smallest to the largest. The second function calculateMean) receives a list of numbers and calculates. The mean is then returned as a float Remember the mean is the sum of all numbers divided by the number of numbers. More specifically Where N is the size of the list and x, is an element in the list. The third function calculateStandarDev) receives a list of numbers and calculates the standard deviation. This standard deviation is returned as a float. The standard deviation in statistics measures the spread of the numbers from the mean. It is the square root of the variance, which is the sunm squared error divided by the number of values less 1. More specifically: Standard Deviation = The fourth function outlier()receives a list of numbers and returns a list of outliers from that initial list of numbers. An outlier is a number that is more than 3 standard deviations away from the Mean of the set of numbers. That is a number that is either bigger or smaller than the Mean by 3 times the standard deviation Once you write these functions, you can test them separately. Then write a program that asks a user to enter a list of numbers, displays the list sorted, the mean and the standard deviation as well as the list of outliers (if any) for that entered list. You should be able to enter numbers with a decimal point. The program should ask you whether you want to enter another set of data or quit. Here is an example of output:Enter a set of numbers (separated by space) 12 13 12 12 11 10 98 12 [8.0, 9.0, 10.0, 11.0, 11.0, 11.0, 11.0, 12.0, 12.0, 12.0, 12.0, 12.0, 13.0, 13.0, 14.0, 2000.0 The Mean is: 135.6875 Std Dev. is: 497.15225283609044 Outliers [2000.0] Do you want to enter more data? (Y/N) :y Std Dev. is 1.8124350015712645 Outliers: [-7.0, 8.0] Do you want to enter more data? (Y/N) :y Enter a set of numbers (separated by space): 10 11 12 11 13 12 14 11 10 11 -3 11 10 10 [-3.0, 10.0, 10.0, 10.0, 10.0, 11.0, 11.0, 11.0, 11.0, 11.0, 12.0 12.0, 13.0, 14.0 The Mean is: 10.214285714285714 Std Dev. is 3.984171980929836 Outliers: -3.01 Do you want to enter more data? (Y/N) :n

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution