Python: Replacing item in a list of lists
<p>Heres my code:</p>

<pre><code>data = [
[5,3,0,0,7,0,0,0,0],
[6,0,0,1,9,5,0,0,0],
[0,9,8,0,0,0,0,6,0],
[8,0,0,0,6,0,0,0,3],
[4,0,0,8,0,3,0,0,1],
[7,0,0,0,2,0,0,0,6],
[0,6,0,0,0,0,2,8,0],
[0,0,0,4,1,9,0,0,5],
[0,0,0,0,8,0,0,7,9]
]

element = 4
x = 0
y = 0

   data[x][y] = element
</code></pre>

<p>I want to replace the element at coordinates 0,0 but when i print data it hasnt changed the element.</p>

<hr>

<p><em><strong></em></strong><em>EDIT</em><strong><em></strong>: OK SO HERES MY FULL CODE:</em>*</p>

<pre><code>data = [
[5,3,0,0,7,0,0,0,0],
[6,0,0,1,9,5,0,0,0],
[0,9,8,0,0,0,0,6,0],
[8,0,0,0,6,0,0,0,3],
[4,0,0,8,0,3,0,0,1],
[7,0,0,0,2,0,0,0,6],
[0,6,0,0,0,0,2,8,0],
[0,0,0,4,1,9,0,0,5],
[0,0,0,0,8,0,0,7,9]
]

z = []

#row 6
x1 = 6
for y in range(9):
  print data[x1][y]
  z.append(data[x1][y])


#column 8
y1 = 8 
for x in range(9):
  print data[x][y1]
  z.append(data[x][y1])


#finds the block coordinates
x = 6
y = 8
basex = x - x%3
basey = y - y%3
for x1 in range(basex,basex+3):
    for y1 in range(basey,basey+3):
        print x1,y1, data[x1][y1]
        z.append(data[x1][y1])

item = [1,2,3,4,5,6,7,8,9]
for element in item:
    if element not in z:
            print element

data[x][y] = element 
print data[x][y]
</code></pre>
