Question: Using Python; Ask user to type numbers one by one; ask for confirmation for every new number. If user types something, that is not a

Using Python;

Ask user to type numbers one by one; ask for confirmation for every new number.

If user types something, that is not a number, print a message and continue asking.

Stop asking if "N" is answered; continue with answer "Y". If the answer is something else, ask again for the correct confirmation until getting "N" or "Y".

Find and print the arithmetic average of entered numbers.

If there are no numbers entered print a message and finish.

Example:

Using Python; Ask user to type numbers one by one; ask for

I am going to calculate the arithmetic average of your numbers New number? (Y/N) Y Type a number: 4 New number? (Y/N) Y Type a number: 3,5 This is not a number New number? (Y/N) Y Type a number: 3.5 New number? (Y/N) enough Please answer only 'Y' or'N' New number? (Y/N) finish Please answer only 'Y' or'N' New number? (Y/N)N Your average is 3.75 >>> |

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!