I need to append a list to a 2D list so that I can edit the added list. I have something like this:
n = 3
a = [
    ['a', 2, 3],
    ['b', 5, 6],
    ['c', 8, 9]
]
b = [None for _ in range(n)]    # [None] * n
print b
a.append(b)
a[3][0] = 'e'
print a
a.append(b)
a[4][0] = 'f'
print a
The result I am getting is:
[None, None, None]
[['a', 2, 3], ['b', 5, 6], ['c', 8, 9], ['e', None, None]]
[['a', 2, 3], ['b', 5, 6], ['c', 8, 9], ['f', None, None], ['f', None, None]]  
The e in 4th row changes to f, which I don't want. With [None] * 3 I get same result. How do I prevent this from happening? I checked how to create a fix size list in python and python empty list trick but it doesn't work.
 
     
     
    