list=[]
list_start=[[1,2], [2,2], [1,3]]
for element in list_start:
list.append(element)
list[0].append([2,3])
print "list=", list
The result is,
list= [[1, 2, [2, 3]], [2, 2], [1, 3]]
instead of
list= [[1, 2], [2, 3]], [2, 2], [1, 3]]
If check:
>>> list[0]
[1, 2, [2, 3]]
>>> list[0][0]
1
>>> list[0][2]
[2, 3]
Why does it like this? I am confused. Thanks a lot!