๐Ÿ PyQuest๐Ÿ•น๏ธ Challenge Arcade ยท โž• Add It Up
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

Add It Up โž•

What is 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10?

Don't do it in your head โ€” make Python do it. ๐Ÿงฎ

The pattern is a running total: a variable that starts at 0 and grows every time round the loop.

total = 0
for number in range(1, 4):
    total = total + number
print(total)          # โžœ 6   (that's 1 + 2 + 3)

Remember range(1, 4) gives 1, 2, 3 โ€” it stops before the second number. Sneaky! ๐Ÿ

Your mission

Add up every number from 1 to 10 with a loop, then print the total.

(No typing the answer. I'll know. ๐Ÿ‘€)

Your code

Press โ–ถ Run to see what your code does!