newbie : array initialization, anyone ?

Hamish Lawson hamish_lawson at yahoo.co.uk
Thu Dec 28 14:22:54 CET 2000


Oops, careless editing in my last post resulted in this:

    multidim = [([0] * 10)[:] for i in range(3)]

The [:] is of course unnecessary there, as [0] * 10 is evaluated each
time:

    multidim = [[0] * 10 for i in range(3)]

Hamish Lawson


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list