Question: Write a program that calculates some basic statistics from a set of sales using a function called calstats() that takes the sales as parameters, calculates
Write a program that calculates some basic statistics from a set of sales using a function called calstats() that takes the sales as parameters, calculates the min, max, range, and average, and prints the output as shown below. Ensure that all inputs are entered as numbers. In addition, make sure that the correct number of arguments are provided (there should be 5 inputs). DO NOT USE INPUT COMMAND. Use sys.argv
Input at runtime:
A. 200 100 50 600 300
B. 100 700 300
C. 100 700 300 test 500
Output:
A. Min: 50
Max: 600
Range: 550
Average: 250
B. The wrong number of sales provided.
C. All inputs should be numeric.
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
