Question: CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS. Write
CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS. CANNOT USE INPUT FUNCTION OR LISTS.

Write a program that repeatedly reads inputs using a while loop until it reads "done". The inputs could be numbers and words. The program should detect non-numeric inputs using try/except and skip the words unless it is "done". Once it reads "done", print out the summation of numbers, number of numbers, and the average of the numbers, and the program terminates. Some sample outputs are shown below. Use the round function to have at most 2 decimal places in the answer. Input: a) python C:\Users eda\Data Programming\M5\assign5-1.py 10 3 -1 cat 2 3 0 test i done 1 2 b) python C:\Users eda\Data Programming\M5\assign5-1.py cow dog 1 2 3 9 -2 done c) python C:\Users eda\DataProgramming\M5\assign5-1.py done 2 3 1 cat Output: a) total:18, count:7, average:2.57 b) total:13, count:5, average:2.6 c) total:0, count:0, average: 0 2. Filename: assign5-2.py Write a program the same as assign5-1. In the end, instead of average, print out the max and min value of the numeric inputs. You are not allowed to use predefined python max and min functions. Input: a) python C:\Users eda\Data Programming\M5\assign5-2.py 10 3 -1 cat 2 30 test 1 done 1 2 b) python C:\Users eda\Data Programming\M5\assign5-2.py cow dog 1 2 3 9 -2 done Output: a) total:18, count:7, max:10, min:-1 b) total:13, count:5, max:9, min:-2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
