Declaring array of Variables ?

Chris Rebert clp2 at
Sun Sep 13 07:06:46 CEST 2009

On Sat, Sep 12, 2009 at 9:51 PM, Lennyboi <leonidas01.rei at> wrote:
> Can I declare an array of variables in python like in C
> int p[10];
> I looked everywhere, but I don't find any mention of it.

Python doesn't have C-like variable declarations, and it does not have
arrays of static length.
The closest you can get is a list prefilled with certain number of
duplicates of a certain value.

p = [0] * 10

or for non-numbers:

p = [None] * 10


More information about the Python-list mailing list