I have a list which looks like this:
my_list =
[['BCN', '01-01-2021', '08:30:30'],
['MCR', '01-01-2021', '12:48:12'],
['TNG', '01-01-2021', '10:01:02']]
For every list in my_list iam trying to join index[1] + index[2] and write it back in a new list.
This is my code:
new_list = []
for row in my_list:
' '.join(row[1] + row[2])
new_list.append(row)
print(new_list)
This is my output:
[['BCN', '01-01-2021', '08:30:30'],
['MCR', '01-01-2021', '12:48:12'],
['TNG', '01-01-2021', '10:01:02']]
This is my expected output:
[['BCN', '01-01-2021 08:30:30'],
['MCR', '01-01-2021 12:48:12'],
['TNG', '01-01-2021 10:01:02']]