Thanks,
my problem was the following :
list=[1,2] i wanted to copy list into another list: list2=list correct way to do this is : list2=list[:]
Thanks,
my problem was the following :
list=[1,2] i wanted to copy list into another list: list2=list correct way to do this is : list2=list[:]
r=d just makes r point to the same list as d. It does not make a copy. If you want to modify one without changing the other, you actually do need to make a copy. One way of doing this would be to do
r = d[:]