I have a list
task_list = ['A1.wakeup', 'A2.brush','B1.route','B2.breakfast']
the result i want is
task_list = ['1A1.wakeup', '1A2.brush','2B1.route','2B2.breakfast']
I use a for loop:
new_task_list = task_list[:]
for task in new_task_list:
task.replace('A', '1A')
task.replace('B','1B')
In [61]: new_task_list
Out[61]: ['A1.wakeup', 'A2.brush', 'B1.route', 'B2.breakfast']
It does not change, What's the problem?