Question #300961

Write a program to enter the numbers till the user enter ZERO '0' and at the end it should display the sum of numbers entered.


Expert's answer

#Write a program to enter the numbers till the user enter ZERO '0' and at the end it should display the sum of numbers entered.


Sum = 0
n='1'


while(n!=0):
    n = int(input("Enter a non-zero number = "))
    Sum = Sum + n
print("\nSum of all numbers = ",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!

LATEST TUTORIALS
APPROVED BY CLIENTS