I have this list (python):
[[item1],[item2],[item3],[/],[item4],[item5],[item6],[/]...]
I want to separate these into chunks and the elements that will go into each chunk are the elements before the separator "/".
So my chunks would look like:
chunk1 = [[item1],[item2],[item3]]
chunk2 = [[item4],[item5],[item6]]
I've tried and tried, nothing efficient came to mind. Tried looping through it with a for and and if element[x] == '/' then get some positions. It's very dirty and doesn't properly work.
Any help would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…