Question #138713

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.

Expert's answer

total = 0
for i in range(99,0,-1):
    total += i
    print("running total:",total)


print("total: ",total)
LATEST TUTORIALS
APPROVED BY CLIENTS