Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started