Skip to content
Sign upLog in

4.2 Code Practice: Question 2

Profile icon
JenniferMusa

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.
Sample run:
Enter a number: 1
Enter a number: 41
Enter a number: 36
Enter a number: 25

Sum: 103
Numbers Entered: 4

You are viewing a single comment. View All
Profile icon
Vandesm14

@JenniferMusa
You need to indent the code you want inside the while loop. Python does not use brackets: instead, it uses indentation to figure out which code is in which block.