On Fri, Feb 13, 2009 at 11:01 AM, bob gailer <[email protected]> wrote:
> Moos Heintzen wrote:
>
>> <snip> I guess I can't reference [0] on an empty list. (I come from a C
>> background.)
>>
> Can you have an empty array in C? If so, it does not have any elements, so
> you can't refer to element 0.
I think the OP was confusing an empty array in C (something like int foo[10]
= {}; ) where memory is allocated, just not "used", to an empty list in
Python.
AFAIK, creating an empty list in python is a lot more similar to creating an
empty vector in C++.
-Wayne
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor