Question: Rearrange the following lines so that the code properly reads a sequence of integers and computes and prints their sum, using -1 as a
Rearrange the following lines so that the code properly reads a sequence of integers and computes and prints their sum, using -1 as a sentinel. Not all lines are useful. Empty print statements are included for output formatting. How to use this tool Unused while value != 8: while value >= -1: value= int(input ("Enter a value or -1 to finish: ")) print() main.py total = 0 value = int(input ("Enter a value or -1 to finish: ")) print() while value != -1: total= total + 1 total= total value Load default template... print(total)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
