a = [10, 23, 56, [78]]
b = list(a)
a[3][0] = 95
a[1] = 34
print(b)
Output: [10, 23, 56, [95]]
Is there any particular reason why the nested value gets changed from 78 to 95; however, the value at the index value = 1 remains 23 only?
Edit explaining my question better:
I've received comments explaining that when I do new_list = old_list
, changes made in any list will be seen in both the variables. But what I don't understand in this particular case is that why is only one value changing i.e. 95, but not the other value i.e. 23.