I'm using Flask web framework with bootstrap, and for my enumeration of posts, I have a for each (post) in (posts) loop outputting the code for each post.
I want to make every 1st post one color, every 2nd post another, etc.
My instinctive approach is to declare an integer before the loop at 1 and then mod 3 that integer to decide which color to make the post, and then increment the integer.
However, Flask won't let me declare just an integer i = 0 like so
{{ i = 0 }}
That's probably glaringly wrong to people here, but I don't exactly get what kinds of things I can do with {{ }}.
Can anyone tell me if my approach is completely off and there is another easier way to do this, or what I am I doing wrong with my approach?