How do I initialize a list please?

Terry Reedy tjreedy at udel.edu
Tue Dec 31 10:30:46 EST 2002


"OUTLand" <cmfinlay at SPAMmagnet.com.au> wrote in message
news:ncc31vghl2c14mage2skeueuffkdpcnnt4 at 4ax.com...
> How do I initialize a list please?
> In Python
> I want to create a list with the same value each time.
>
> my current way is
>
> QUOTE
> dim = [1.0, 1.0, 1.0, 1.0, 1.0, \
>               1.0, 1.0, 1.0, 1.0, 1.0]
> UNQUOTE

dim = [1.0]*10

tjr





More information about the Python-list mailing list