What I am trying to do is pretty simple, but I couldn't find how to do it.
- Starting with 1st element, put every 4th element into a new list.
- Repeat with the 2nd, 3rd, and 4th elements.
From:
list = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b']
To:
list1 = ['1', '5', '9']
list2 = ['2', '6', 'a']
list3 = ['3', '7', 'b']
list4 = ['4', '9']
In other words, I need to know how to:
- Get the Nth element from a list (in a loop)
- Store it in new arrays
- Repeat