osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

indexed assignment in list


Peter Otten wrote:

> a = [[1]] * 7
> 
> creates a list containing seven references to the same inner list [1].

I. e. it is roughly equivalent to

b = [1]
a = [b, b, b, b, b, b, b]