2022-10-19 08:28:58 -07:00

14 lines
208 B
Python

.
.
.
numbers = range(1, 101) # 1 up to 100
# sum: Imperative solution
def imperative_sum(numbers):
total = 0
for n in numbers:
total += n
return total
print(imperative_sum(numbers))