I have this list
[['a', 'a', 'a', 'a'],
['b', 'b', 'b', 'b', 'b'],
['c', 'c', 'c', 'c', 'c']]
and I want to concatenate 2nd and 3rd elements in each row, starting from the second row, to make something like this:
[['a', 'a', 'a', 'a'],
['b', 'bb', 'b', 'b'],
['c', 'cc', 'c', 'c']]
It seems to work fine, when I do it to every row:
for index, item in enumerate(list_of_lines, start=0):
list_of_lines[index][1:3] = [''.join(item[1:3])]
but when I'm starting from the second row - I have "list index out of range" error:
for index, item in enumerate(list_of_lines, start=1):
list_of_lines[index][1:3] = [''.join(item[1:3])]