Question: Write a program, in a file named running_total.py, which reads a series of integers. There might be multiple integers in a single line of input;

Write a program, in a file named running_total.py, which reads a series of integers. There might be multiple integers in a single line of input; if so, they will be separated by whitespace. Some lines of input might be blank. Break out of the loop, and terminate the program, if you ever read the value -1. Do not print out the line for the -1. (Note: The -1 might be in the middle of a line; if so, don't process the numbers on the rest of the line.) I recommend that you structure program as follows: keep-going = True while keep-going: ... read one line of input for each word in this one line of input: convert the word to an integer if it is time to end the program: keep-going = False break else: ... update and print out current status ... Each time that you read a new integer, you will print out one line of input. The primary purpose is to keep track of a running total of all of the integers; however, you will also print out other information about the loop. Each line will look like this: Total: 1234 - numbers: 10 total_lines:4 blank_lines:1 SPECIAL RESTRICTION: (this program only) For this program only, you must use f-strings to format your output. Not familiar with them? Watch the Python Review videos that I've posted! On other programs, you have complete freedom - but I think that you will love f-strings once you've tried them. BANNED FUNCTIONS: (throughout this course) Some resources online will tell you that, to terminate a Python program, you can call os._exit() or sys.exit(). While it is technically true that you can do this, it is ugly and error-prone, and so it is banned in this course. To end a program, please work out how to break out cleanly from your loops. Don't just kill the program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
