multidimensional "arrays"

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Dec 6 10:42:34 EST 2007


Horacius ReX:
> do you know how to do similar but in two dimensions ?

>>> nr = 3
>>> nc = 4
>>> [[None] * nc for _ in xrange(nr)]
[[None, None, None, None], [None, None, None, None], [None, None,
None, None]]

Bye,
bearophile



More information about the Python-list mailing list