I am trying to change something in every second element of my array. In that element then I only want to modify the 5th element (it's an array of arrays). I want to do so by just having a step of 2 in my while-loop. Therefore I added i += 2
.
Now it's weird:
when I put only in:
PaylikeTableWithFee[i] = 'hello'
Then it works and only every second array is modified and set to 'hello'.
However when I do so:
PaylikeTableWithFee[i][5] = 'hello'
Then every array is modified although the loop has a step of 2.
i = 1
while i < len(PaylikeTableWithFee):
PaylikeTableWithFee[i][5] = 'hello'
i += 2
Normally only the 5th element of every 2th array inside the main-array should be edited.