vncolella2006 vncolella2006
  • 08-11-2020
  • Computers and Technology
contestada

Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the count of how many numbers were entered.

Respuesta :

Cytokine
Cytokine Cytokine
  • 08-11-2020

total = 0

count = 0

while total < 100:

   num = int(input("Enter a number: "))

   total += num

   count += 1

print("Sum: {}".format(total))

print("Numbers Entered: {}".format(count))

I'm pretty sure this is what you're looking for. Best of luck!

Answer Link

Otras preguntas

I NEED HELP PLEASE! I'm stuck between C or D.
Se buscan (1) para compañía internacional. Los aspirantes (2) tener cinco años de experiencia en esta área y demostrar que tienen un nivel alto de inglés habl
Read Stephano's reaction to Caliban in Shakespeare's The Tempest. This is some monster of the isle with four legs, who hath got, as I take it, an ague. Where th
complete q^2+3q-54=(q-6)(q+?)
Explain the difference between experimental and theoretical probability.
In the Kennedy Nixon debate what was the purpose of the argument on each side ?
Which characteristics are most common when defining the term developing nation?
Help me please please
For which action did theodore roosevelt win the 1906 nobel peace prize?
Based on what you know of Book XI, what is the most likely meaning of the underlined word, verity, as it is used above?