dumb newbie list question

Dan Girellini drg at longhands.org
Sun Aug 19 18:45:21 EDT 2001


Maybe this is a naive/stupid question, but is there anyway to grow a list to an
arbitrary size?  Eg.:

>>> l = [1, 2, 3]
>>> l[5] = "x"

won't work (obviously).  Is there an easy way to do this without building a
second list of the right size and concatenating them?  

I'm trying to drop my perl habits when using python, really!

TIA.

--dan.




More information about the Python-list mailing list