4.9 Code Practice: Question 3
Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well as the total at the end. The program should use one for loop, the range() function and one print() command.
Sample Run
99
197
294
390
…
…
…
4940
4944
4947
4949
4950
Answers
Answered by
3
_sum = 99
for n in range(99, 0, -1):
print(_sum)
_sum += n - 1
Similar questions
Math,
2 months ago
Math,
2 months ago
Chemistry,
2 months ago
Social Sciences,
4 months ago
Geography,
4 months ago
Social Sciences,
10 months ago