[Tutor] Initializing a list as an array

Scott syrinx@simplecom.net
Fri, 7 Dec 2001 19:26:11 -0600


On Friday 07 December 2001 07:24 pm, you wrote:
>
 >Suppose I want to initialize a list that I want to use like an
> >array, setting the initial value of each element to zero.
> >
>    >>> mylist = [0]*10
>    >>> mylist
>    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

I thought it would be something like that.  I played around with several 
variations, but couldn't get it to work.  Thanks Kirby.