How do you create a simple for-loop in the dev template window?

I have defined a simple array in the developer template window.

{% set days = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] %}

Now I want to create a for loop such as (this is pseudo-code}}
this is what I’m trying to do in the dev window

for i = 1 to 7
   Day: {{i}} {{days[ i - 1]}}
next

So I’ll see in the dev window output:

Day: sun 
Day: mon
Day: tue 
Day: wed
Day: thu
Day: fri
Day: sat

I’m specifically looking to use numbers instead of a for-each type of loop, because I might want the loop to be for i = 6 to 7 instead.

You could loop a range of 7:

{% set days = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] %}

{% for i in range(7) %}
  Day: {{i}} {{days[ i ]}}
{% endfor %}

Then you could set a if to limit the loop.

{% for i in range(7) %}
  {% if i > 2 %}
     Day: {{i}} {{days[ i ]}}
  {% endif %}
{% endfor %}