I have to do a code where I have to change some value in a for loop.
I have a list called listElement.
I know the exact position of the item that I want to change which is store in a list. For instance [2,2,1] called index (which can also be for instance [3,2] because my listElement is composed of several lists of different sizes).
I would like to do something like this :listElement + index which can create something like listElement[2][2][1] (or listElement[3][2])
listElement = [ "a" , ["b","c"] , [["d"],["e","f"]] ]
tab = [ [2,1,0] , [0] ] # "e" and "a" position
element=""
for i in tab :
# recuperate the element at the position indicate by i
element = listElement[i]