Question: Using Python: My hw_stats() function: The standard deviation of a dataset is a measurement of how spread out it is. Modify your hw_stats() function to

Using Python:

Using Python: My hw_stats() function: The standard deviation of a dataset is

My hw_stats() function:

a measurement of how spread out it is. Modify your hw_stats() function

The standard deviation of a dataset is a measurement of how spread out it is. Modify your hw_stats() function to also display the standard deviation of your homework scores, using the following formula: n-1 SD = 1 * 2 (scores[i] mean)? i=0 (If you're unfamiliar with the capital sigma 2, you can read about summation notation here.) Since this formula requires the mean that you computed in Exercise 2, naturally any calculations you need to perform must occur after your code for the previous exercise. Here is a possible strategy for solving this problem (you may choose another approach): 1. Modify your original solution to also store all the homework scores in a list. 2. After calculating the mean, loop through the list of scores and accumulate the summation part of the formula: (scores[i] mean)? n-1 i=0 3. Divide by n, take the square root, and display the result. You can test your answer using Python's built-in pstdev() function in the statistics library (don't forget to import it!). If you have a list of numbers called values, you can display its standard deviation like this: print(statistics.pstdev(values)) Edefmhw_stats: n = int(input("Enter the number of assignments")) total=0 for i in range(1,n+1): print("Enter your grade on HW"zin": "aend='') no = float(input()) total=total+no print("Your overall average is : "{0:.1f}".format(total))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!