The forloop object
The forloop
object contains attributes of its parent for loop.
forloop.first
Anchor link to section titled "forloop.first"Returns true
if it's the first iteration of the for loop. Returns false
if it is not the first iteration.
forloop.index
Anchor link to section titled "forloop.index"Returns the current index of the for loop, starting at 1.
forloop.index0
Anchor link to section titled "forloop.index0"Returns the current index of the for loop, starting at 0.
forloop.last
Anchor link to section titled "forloop.last"Returns true
if it's the last iteration of the for loop. Returns false
if it is not the last iteration.
forloop.length
Anchor link to section titled "forloop.length"Returns the number of iterations of the loop.
forloop.rindex
Anchor link to section titled "forloop.rindex"Returns forloop.index in reverse order.
forloop.rindex0
Anchor link to section titled "forloop.rindex0"Returns forloop.index0 in reverse order.