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.
#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)
Comments
Leave a comment