Need help initializing a list or tuple.

Diez B. Roggisch deets at nospam.web.de
Mon Mar 6 12:42:47 EST 2006


KraftDiner schrieb:
> Thank you that worked great!
> 
> a = [[None] * 256] * 256
> for i in range(0,256):
> 	for j in range(0,256):
> 		a[i][j] = i**2
> 
> Now.. Can I change this quickly into a 1 dimensional list of length
> 65536?

sum(a, [])

Diez





More information about the Python-list mailing list