Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started