If I write the following code:
a = [] b = a b.append(2)
Then a = [2]. Is there a way I can break the reference between b and a, so that even if I modify b, a will not be modified?
You can, if you copy its content with
b=a[:]
You can, if you copy its content with