[Tutor] variable initialization

alan.gauld@bt.com alan.gauld@bt.com
Wed, 2 Oct 2002 12:03:49 +0100


> Say I'm wanting to initialize a large number of variables to 0 or even
> as lists.

> Is there a way to do this with a range statement or something?

No, because you still have 100 names(ie variables) that must be 
individually initialised.

But it would be extremely unusual to have that many variables. 
Normally you'd be using some kind of list or dictionary instead.
Lists or dictionaries can normally be initialised within loops.

Can you give us a clue as to what you expect to do with 100 
variables? Maybe we can suggest a better design solution?

Alan G.