You are on page 1of 1

SALUDES, CHLOE FEBB VENUS

BSEE 1B
0120-0774
Direction: Create a program that adds every number entered by the user. It would only stop and display
the sum when the user entered 0.

Use this code when accepting the user input as an integer:


number = int(input("Enter a number to be added and enter 0 to display the sum of all numbers:"))

Expected output:

Enter a number to be added and enter 0 to display the sum of all numbers: 5
Enter a number to be added and enter 0 to display the sum of all numbers: 8
Enter a number to be added and enter 0 to display the sum of all numbers: 3
Enter a number to be added and enter 0 to display the sum of all numbers: 15
Enter a number to be added and enter 0 to display the sum of all numbers: 0
The sum is: 31

You might also like