Here is my code, i cannot figure out the difference between these two lists of list:
cow = 1
column = 1
size = 3
board1=[[0,0,0],[0,0,0],[0,0,0]]
print board1
board2=[[0] * size] * size
print board2
if board1==board2: print 'same'
board1[cow][column] =1
board2[1][2] =1
print "Board 1 is :", board1
print "Board 2 is :", board2
Result:
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
same
Board 1 is : [[0, 0, 0], [0, 1, 0], [0, 0, 0]]
Board 2 is : [[0, 1, 0], [0, 1, 0], [0, 1, 0]]