well, at a guess something like (not tested): ... # this is a global 'const' so conventionally uses CAPS SEGMENT_PATTERN = [[0,1,2,3,4,5],[1,2],[0,1,6,4,3],[0,1,2,3,6],[1,2,5,6],[0,2,3,5,6], #0 to 5 [0,2,3,4,5,6],[0,1,2],[0,1,2,3,4,5,6],[0,1,2,5,6],[0,1,2,4,5,6], #6 to A [2,3,4,5,6],[0,3,4,5],[1,2,3...