I'm making some changes to a list, however, these changes are being reflected in the copy of the original list.
I tried using these methods: copy_list = list(org_list), copy_list = org_list[:], copy_list = org_list.copy()
They didn't work.
Here's my code followed by the output. Where am I going wrong?
name = ['A', 'B', 'C', 'D', 'E']
desc = [["1"], ['1', '2'], [], ['1', '2'], []]
desc1 = desc.copy()
for n, d in zip(name, desc):
d.insert(0, n)
print(desc1)
Output (the alphabets shouldn't be visible): [['A', '1'], ['B', '1', '2'], ['C'], ['D', '1', '2'], ['E']]