← Reading Code · Lesson 3 of 3
One turn at a time
A loop repeats some lines. "For n from 1 to 3: total = total + n" runs three times, with n being 1, then 2, then 3.
Follow it one turn at a time in your table. If total starts at 0: after the first turn it is 1, after the second 3, after the third 6.
total = 0; for n from 1 to 3: total = total + n. What is total at the end?
A lesson is kept once you've answered the question and written at least 8 words. Nobody grades it; it stays on this device.