How do I ignitalize a list please?
kcazabon at home.com
Wed May 3 06:51:16 CEST 2000
This is covered very well (as well as most other aspects of Python) in the
documentation, specifically the Tutorial.
However, in brief, you simply need to create the empty list first, as
list = 
for i in range(42):
list.append(i * 42)
i = "Eggs"
However, if you simply say that list=, you cannot then assign to list
because it doesn't exist yet. You have to append X number of objects to the
list, or create the list with that many elements in the first place using a
<cmfinlay at SPAMmagnet.com.au> wrote in message
news:kSUtN6=fLIxjJNG0pGTq25a0tuiY at 4ax.com...
> How do I initialize a 'list' please?
> I read that a list is the only array that can be modified in standard
> (to put it simply)
> i = 1
> mags = 0
> mags = 1
> print mags[i]
> doesn't work.
> Please reply here
> or at cmfinlaySPAM at magnet.com.au
More information about the Python-list