I have a problem when I try to work with a list and a copy of it. I know that there are certain ways to copy a list in Python and I think that I follow them. Here is my problem.
a = []
for i in range(10):
a.append([0]*10)
b = a[:]
for j in a:
j[0] = 1
print a
print b
I create a blank list. Then I add 10 sublists of zeros ([0,0,0,0,0....]). Then I copy the list and finally I iterate through the first one. But when I print them, both lists have been changed.