I have been using Python for some years now but just noticed a very confusing thing.
a=[[]]*3
a[0].append(3)
and
a=[[] for i in range(3)]
a[0].append(3)
do not have the same effect even though the type (list) is the same.
The first yields a=[[3], [3], [3]]
, the second a=[[3],[],[]]
(as expected).
Does anybody have an explanation?