Mid2 5th_Sum_of_Entered_Numbers
sum=0
x=1
while(x!= 0):
x=int(input("Enter a number: "))
sum=sum + x
print("Sum of the entered numbers : ",sum)
#output:
Enter a number: 2
Enter a number: 2
Enter a number: 3
Enter a number: 0
Sum of the entered numbers : 7
Comments
Post a Comment