In C++/C, I can write the following:
string s;
int window_len = 3;
for (int i = 0, j = window_len; j <= s.length(); i += window_len, j += window_len) {
//do things with s.Slice(i, j)
}
Is there a pythonic way of expressing the above composite for loop?