i've met a problem when using the append function of python. if i code like this:
a={}
a[1]=[1]
b=copy(a)
b[1].append(2)
print (a)
the result will be:
{1: [1, 2]}
why? i think that using the copy function, the address of anything related to b will not influence a. but this append function is really strange! could anyone please tell me how this works? how could i append something without influencing the original address? thanks a lot!