I cannot understand why the piece of code described below does what it does
import numpy as np
N = 2
A=[];
B=[];
for i in range(N):
B.append(i)
A.append(B)
The first time the for loop runs (for i =0), A = [[0]]. The second time the loop runs (for i =1), B = [0,1] and so I expect A = [[0],[0,1]], since we are appending B to A. However, when I print A, I get A = [[0,1],[0,1]]. Why do I not get the form I expect?