Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are creating a loop that will capture numbers from the user and add them in a total variable. Once totaled a message is
You are creating a loop that will capture numbers from the user and add them in a total variable. Once totaled a message is displayed depending on the total. Write a program that: Repeatedly reads numbers until the user enters 'done. Once 'done' is entered, break out of the loop. If the user enters anything but a number, capture the error using a try-except construct and display the message "Bad Data" Once 'done' is entered print out one of 2 messages: If the total is greater or equal to 200 then: "The total (the value in the total variable) for the numbers entered is Large" If the total is less than 200 then: "The total (the value in the total variable) for the numbers entered is Small" C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64 Please enter a number to add: 45 Please enter a number to add: 34 Please enter a number to add: 3 Please enter a number to add: fff Bad Data Please enter a number to add: 45 Please enter a number to add: 56 Please enter a number to add: done The total 183 for the numbers entered is Small Process returned 0 (0x0) Press any key to continue execution time : 20.476 s Ac Go
Step by Step Solution
There are 3 Steps involved in it
Step: 1
SOLUTION I have solved this problem in Python code with comments and screenshots for easy understand...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