Write a program that reads in a series of numbers and adds them up until the user enters zero (this stopping value is often called a rogue value).
1
Expert's answer
2020-05-29T13:18:06-0400
ROGUE_VALUE = 0
sum = 0
while True:
number = float(input("Enter number:"))
if number == ROGUE_VALUE:
break
sum += number
print("sum is {}".format(sum))
Comments
Leave a comment