newbie : array initialization, anyone ?

Hamish Lawson hamish_lawson at yahoo.co.uk
Thu Dec 28 08:22:54 EST 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