While working on a project I've come across the following two list forms:
1)
l1=[10]*2
p1,p2=l1
2)
l2=[]
for i in xrange(2):
l2.append(10)
p1,p2=l2
Both appear to have the same output (as in l1=l2
) but when I print some graphs they are not the same, so there must be something. Any help or suggestion is greatly appreciated. The above code is a minimal working example.