Question: Python Programming: Write a Python program that does the following: asks the user to enter integers they can indicate they are finished by typing DONE

Python Programming:

Write a Python program that does the following:

asks the user to enter integers they can indicate they are finished by typing DONE

print the following:

number of positive integers

number of negative integers

sum of all entered numbers

average of all entered numbers (displayed with 1 digit to the right of the decimal)

Be sure to label all of your output and format it appropriately.

Be sure to think about all of the test cases for your application what if the user enters DONE immediately, for example?

Bonus +2:

Provide a function called getValidInput. It accepts NO parameters. It should continually ask the user to enter a number until they enter a valid integer (without letters or punctuation or spaces in their entry). It should RETURN a valid integer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!