I am trying the following steps (to copy a list of list, and to change the last item of each list)
list_weight=[['B', 'A', 5], ['B', 'D', 1], ['B', 'G', 2], ['A', 'B', 5], ['A', 'D', 3], ['A', 'E', 12], ['A', 'F', 5], ['D', 'B', 1], ['D', 'G', 1], ['D', 'E', 1], ['D', 'A', 3], ['G', 'B', 2], ['G', 'D', 1], ['G', 'C', 2], ['C', 'G', 2], ['C', 'E', 1], ['C', 'F', 16], ['E', 'A', 12], ['E', 'D', 1], ['E', 'C', 1], ['E', 'F', 2], ['F', 'A', 5], ['F', 'E', 2], ['F', 'C', 16]]
list_time = [i for i in list_weight]
for i in list_time:
i[-1]=dt(2021,6,15,random.randint(0, 23))
print(list_time==list_weight)
Finally, I obtain that list_time is equal to list_weight and I don't know why. I have tried to use .copy method or list_time = list_weight[:] but they don't work.
Thank you