jeudi 26 juin 2014

breaking appended list into indexes


Vote count:

0




So right now i have code that gives me


[-1], [1], [-1], [-1], [2], [3], [4], [-1], [5], [6], [7], [-1], [-1], [-1], [8], [9], [-1], [-1], [-1], [10]]


but i want it to look like so


myVV = [[-1, 1, -1, -1],[ 2, 3, 4, -1],[5, 6, 7, -1],[-1, -1, 8, 9],[ -1, -1, -1, 10]]


i have a for loop with a inserted line


myVV.append([])


that gives me this


[[], [-1], [1], [-1], [-1], [], [2], [3], [4], [-1], [], [5], [6], [7], [-1], [], [-1], [-1], [8], [9], [], [-1], [-1], [-1], [10]]


it inserts the break were i want the split of indexes to happen.


Any things to read that would help me solve this?



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire