Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
def sum_to(n):
total = 0
for i in range(1, n + 1):
total += i
return total
print(sum_to(10))