← Code LabPython0/50 solved · 0%
Control flow · easy

5. for loops and range

Repeat work over a range.

Write `sum_to(n)` returning `1 + 2 + ... + n` using a `for` loop over `range`.
Required in your answer: for range(