(Solved) : ~python~ Count Positive Negative Numbers Compute Average Numbers Write Program Reads Unspe Q36607822 . . .

$9.00

~Python~

(Count positive and negative numbers and compute the average ofnumbers) Write a program that reads an unspecified number ofintegers, determines how many positive and negative values havebeen read, and computes the total and average of the input values(not counting zeros). Your program ends with the input 0. Displaythe average as a floating-point number.

Expert Answer


Answer to ~Python~ (Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecif…

Description

~Python~

(Count positive and negative numbers and compute the average ofnumbers) Write a program that reads an unspecified number ofintegers, determines how many positive and negative values havebeen read, and computes the total and average of the input values(not counting zeros). Your program ends with the input 0. Displaythe average as a floating-point number.

Expert Answer


pos_count, neg_count, count, total = 0, 0, 0, 0while True: n = float(input(“Enter a number(0 to exit): “)) if n == 0: break if n > 0: pos_count += 1 else: neg_count += 1 total += n count += 1print(“Number of positive numbers ... View full description