Need help initializing a list or tuple.

BranoZ zarnovican at gmail.com
Mon Mar 6 17:21:26 EST 2006


How about:

a = [ [i**2 for j in range(256)] for i in range(256) ]
b = sum(a, [])
c = [ b[slice(i,i+256)] for i in range(0,256*256,256) ]
>>> a is c
False
>>> a == c
True

BranoZ




More information about the Python-list mailing list