# loops

Count the Steps to Treasure

To reach the treasure, you take steps numbered 1, 2, 3, all the way up to n. Add up every step number along the way! 🗺️

You're given n. Use a for loop and range to add up every whole number from 1 to n (including n), then print the total.

For example, 5 → print 15 (1+2+3+4+5).

💡 need a hint?

loop-count-to-treasure.py🔒 given lines are locked — write your code in between
loading...