On Sat, Sep 12, 2009 at 9:51 PM, Lennyboi <leonidas01....@gmail.com> 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

Cheers,
Chris
--
http://blog.rebertia.com
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to