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:
Enter a real number or q to end data entry:
Enter a real number or q to end data entry:
Enter a real number or q to end data entry:
Enter a real number or q to end data entry:
Enter a real number or q to end data entry: q
The mean is and the standard deviation is
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 stddev. 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
