Question: def positive_statistics( ): Asks a user to enter a series of positive numbers, then calculates and returns the minimum, maximum, total, and average of those

def positive_statistics( ): Asks a user to enter a series of positive numbers, then calculates and returns the minimum, maximum, total, and average of those numbers. Stop processing values when the user enters a negative number. The first number entered must be positive. Use: minimum, maximum, total, average = positive statistics() Returns: minimum - smallest of the entered values (float) maximum - largest of the entered values (float) total - total of the entered values (float) average - average of the entered values (float) value = float (input ( "First positive value: ")) total = 0 count = 0 minimum = value maximum = value while value >= 0: if value maximum: maximum = value total = total + value count = count + 1 value = float (input ( "Next positive value: ") ) average = total / count return minimum, maximum, total, average
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
