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

please help solve this
The scale of a map is 9 inches = 2 miles. How many inches on the map represents 9 miles?
The equation c=13t gives the cost c (in dollars) of t tickets for a play. Identify the independent and dependent variables. help
Hospital patients often receive medications, nutrients, and water intravenously (IV), which means they are injected directly into the patient’s veins through a
if 24 students took a test and 18 passed how much percent passed?
Which value of y makes the equation y/9=12 true
what is the definition for a line segment
Which phrase from the text best shows Mary Wollstonecraft’ s use of figurative language ?
Predecessor and successor of 999​
Does anyone know this?