1. The Countdown
Write a loop that counts down from 10 to 1, then prints "Happy New Year!".
for i in range(10, 0, -1):
print(i)
print("Happy New Year!")
2. Summation (Accumulator)
Calculate the sum of all numbers from 1 to 100 and print the final result.
total = 0
for i in range(1, 101):
total = total + i
print(total)
(Visualizer simplified to range 1-5)
total = 0 + 1