I am working on the following problem.
Write a program that continually prompts for positive integers and stops when the sum of numbers entered exceeds 1000. But my cod
In case you want to stop as soon as you encounter the negative number.
x = 0 total = 0 sum = 0 while (sum <= 1000): x = (int(input("Enter an integer:")) if (x < 0): break else: sum += x