77 413
Assignments Done
Successfully Done
In July 2019

Answer to Question #3241 in Python for Goh

Question #3241
Write a program that repeatedly asks a user to enter a number. The program will sum up all the number that the user keyed in. Terminate the program when the user enters -9, and display the sum of all the numbers entered by the user (exclude -9).
Expert's answer
sum = 0

while True:

number = float(input ("Enter a number: "))

if number == -9: break

sum += number

print ("The sum is", sum)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions