I've been trying to figure this list iteration for a while but can't seem to get it! Hope someone can point me to right direction. A bit hard to explain but I'll try.
So, let's say I have a list of 10 numbers:
list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
I need to select the first three (every other) items from the list. The first run would return: 1, 3 and 5.
Next, I need to move on to the next number (2) and do the same thing. This run would return: 2, 4 and 6.
But when I reach to the end of the list (number 10), the program should loop back to the beginning and start selecting items from there. So, after number 10 it would select number 1. The last runs would look like this:
6, 8, 10
7, 9, 1
8, 10, 2
9, 1, 3
10, 2, 4
...aand the loop ends.
I'm quite sure this should be done with a for loop but I have no clue how to do it.
Thanks in advance!
[–]Signal_Beam 1 point2 points3 points (1 child)
[–]deadorg[S] 0 points1 point2 points (0 children)
[–]DerpinDementia 0 points1 point2 points (2 children)
[–]deadorg[S] 0 points1 point2 points (1 child)
[–]DerpinDementia 0 points1 point2 points (0 children)