Computers and Technology

4. Fill in the code so it adds all integers inputted by the user until the number -1 is inputted & then displays that sum (without the -1 added to the sum.) Also trace your code assuming the user inputs the values 4, 3, 1, -1 sum = 0 sum num
num =

while ( ):

num = int(input("Enter a positive integer (-1 to quit): "))



print(

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:40, hePandaKing3689
State the parts of a variable declaration?
Answers: 2
image
Computers and Technology, 22.06.2019 12:10, tragesserj
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
image
Computers and Technology, 24.06.2019 06:30, chloeholt123
For which utilities, if any, does the landlord pay?
Answers: 2
image
Computers and Technology, 24.06.2019 10:00, RG1971
(, urgent need): how do i change my username
Answers: 1
Do you know the correct answer?
4. Fill in the code so it adds all integers inputted by the user until the number -1 is inputted &am...

Questions in other subjects:

Konu
Medicine, 20.01.2022 14:10