Create your list as follows:
In [6]: a = [[0 for _ in range(rows)] for _ in range(cols)] In [7]: a[2][1] = a[2][1] + 5 In [8]: a Out[8]: [[0, 0, 0], [0, 0, 0], [0, 5, 0], [0, 0, 0], [0, 0, 0]]
Since you are doing this now, it actually just repeats the same list object, so changing one actually changes each of them.
In [11]: a = [[0] * (rows)] * (cols) In [12]: [id(x) for x in a] Out[12]: [172862444, 172862444, 172862444, 172862444, 172862444] #same id(), ie same object
source share