Question: Your program should prompt the user for real numbers and allow the user to quit data entry by entering q . There s no need

Your program should prompt the user for real numbers and allow the user to quit data entry by entering q. Theres no need for validationany real numbers will do. Hint: Start with an empty list, then use a while loop and append each new number to the list.
Once you have a list of real numbers, calculate the mean and the standard deviation and report the results on one line in the order shown, formatted to two decimal places of precision.
Enter a real number or q to end data entry: 10.1
Enter a real number or q to end data entry: 13.9
Enter a real number or q to end data entry: 12.4
Enter a real number or q to end data entry: 16.7
Enter a real number or q to end data entry: 9.5
Enter a real number or q to end data entry: q
The mean is 12.52 and the standard deviation is 2.62.
If the user hits q right away, your program should not fail with a divide by zero error, but rather should report No data!
Enter a real number or q to end data entry: q
No data!
To calculate the arithmetic mean you should write a function called mean. This function should take an arbitrary list of real numbers and return the arithmetic mean.
To calculate the standard deviation you should write a function called std_dev. This function should take an arbitrary list of real numbers and return the standard deviation. Your standard deviation function should either call your mean function or implement mean calculation independently.
Test your program with a variety of inputs to ensure it works as intended.
Note: You may not use Pythons statistics module. Please implement your own standard deviation function as indicated.
Your program should prompt the user for real

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 Programming Questions!