newbie : array initialization, anyone ?
aleaxit at yahoo.com
Wed Dec 27 21:37:30 CET 2000
<arcege at shore.net> wrote in message
news:wgr26.1691$JG.213419 at news.shore.net...
> This is in the FAQ (#4.50). You will want to create each inner dimension
> >>> multidim = [ None ] * 3
> >>> for i in range(3):
> ... multidim[i] = [ 0 ] * 10
Or, more compactly, in Python 2:
>>> mudi = [ *10 for i in range(3) ]
Not sure if the FAQ shows this handy list-comprehension use...?
More information about the Python-list