Question: 4 . 7 . 4 : Fix the code to properly read a sequence of integers, compute, and print their sum. Rearrange the following lines

4.7.4: Fix the code to properly read a sequence of integers, compute, and print their sum.
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. IN PYTHONRearrange 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
print(total)
value = int(input("Enter a value or -1 to finish: "))
print()
total = total +1
total = total + value
while value 0 :
while value -1 :
while value >=-1:
main.py
Load default template...
total =0
value = int(input("Enter a value or -1 to finish: "))
print()
 4.7.4: Fix the code to properly read a sequence of integers,

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!