Question: Your script will be using command line arguments rather than user input. The user must be able to enter one or more numbers as

Your script will be using command line arguments rather than user input. The user must be able to enter one or more numbers as command line arguments. (Use sys.argv). If the user doesn't enter any arguments, the script should print a usage message and stop (Use sys.exit). Each command line argument is considered to be an integer. If a command line argument is not numeric, print an error message and skip it. Keep in mind that the first element of sys. argv is filename! Make sure you skip this when doing your calculations, otherwise you will get ValueError exceptions. Sample Output python lab5e.py Usage: Enter one or more command line arguments. python lab5e.py 2 ten 17 39 Number found: 2. Error: ten is not a number. Number found: 17. Number found: 39. Average for 3 numbers: 19.3
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
Solution Step1 Sure heres a Python script that follows the requirements youve ... View full answer
Get step-by-step solutions from verified subject matter experts
