I have a question about the variables id() in python:
a=[2,3]
b=a
print b
>>>[2, 3]
a.remove(2)
print b
>>>[3]
This is because id(a) == id(b)?; how can I avoid this? I need to define b in another way?
I have a question about the variables id() in python:
a=[2,3]
b=a
print b
>>>[2, 3]
a.remove(2)
print b
>>>[3]
This is because id(a) == id(b)?; how can I avoid this? I need to define b in another way?