Question: Using python s 5.2-5.7 Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers,
s 5.2-5.7 Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the nput 0. Display the average as a floating-point number. Here is a sample run: n integer, the innut ende f it lave your program: . Begin with a program description comment. Comment each variable. Break the program off into sections for each main action (use section comments and blank lines between sections). Use meaningful (descriptive) variable names. Display the prompt and output as shown in the example on pages 158-159. Use the two test cases shown on pages 158- 159. Make sure that if the only input value is 0 that you do not attempt to calculate the average (division by zero error). Note that 0 is the sentinel value, indicating the end of valid input. Do not count this as one of your input values when calculating the average. Round the average to two decimal places- you will need to use format for this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
