I wanted to logically divide a loop every 4 iterations.
Say, for example, I’m looping a list of filenames in an array 10 times, I wanted to run the first 4 filenames, then do a print statement, again loop the remaining 4, do a print statement, loop the last 2 but don’t do a print. In other words, the print statement should not print if the iteration is less than 4. This should be dynamic and it should work for any iteration count (e.g) 167, 282 etc.
Please help.
1 Answer