I have the follow list:
my_list = [
[0, 0, [21, 24]],
[0, 1, [2, 13]],
[0, 3, [1, 15]],
[0, 4, [1, 6]],
[0, 6, [11]],
[0, 7, [1]],
[1, 0, [3, 4, 10, 17]],
[1, 1, [1, 15, 19, 24]],
[1, 2, [1]],
[1, 3, [5, 6, 18]],
[1, 4, [15, 24, 25]],
[1, 5, [10, 22]],
[1, 6, [16, 30, 31]],
[2, 0, [7, 20]],
[2, 1, [5]],
[2, 3, [11, 14]],
[2, 4, [5, 10]],
[2, 5, [15]],
[2, 6, [6, 10]],
[2, 7, [12]],
[3, 0, [11, 18]],
[3, 2, [2, 22]],
[3, 5, [8]],
[3, 6, [15]],
[3, 7, [5]]
]
I want to retrieve the follow data:
[x,y,[z]][x+1,y+1,[z]][x+2,y+2,[z]][x+3,y+3,[z]]
should get:
[0, 3, [1, 15]],
[1, 4, [15, 24, 25]],
[2, 5, [15]],
[3, 6, [15]],
where x is a index of character in a word, y is line number and z is column number. z as you can see can be more than 1 option
final = [(i,j,) for i,j in my_list if i[0]==j[0] and i[1]==j[1]+1 and i[2]==j[2]]
getting ValueError: too many values to unpack
intobject is unsubscriptable now).character- all your values are integers? And what element do you want to get/receive?