Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Environmental And Natural Resource Economics

Authors: Thomas H Tietenberg, Lynne Lewis

10th Edition

1315523965, 9781315523965

More Books

Students also viewed these Economics questions

Question

Briefly describe Bacons four Idols. How do the Idols apply today?

Answered: 1 week ago

Question

2. How do I perform this role?

Answered: 1 week ago