On Sep 23, 2009, at 1:16 PM, Rudolf <yellowblueyel...@gmail.com> wrote:
> Can someone tell me how to allocate single and multidimensional arrays > in python. I looked online and it says to do the following x = > ['1','2','3','4'] > > However, I want a much larger array like a 100 elements, so I cant > possibly do that. I want to allocate an array and then populate it > using a for loop. Thanks for your help. Python lists have a dynamic size so you don't usually do that. Instead, we use list comprehensions to stick the for loop inside the list declaration. [str(x) for x in xrange(100)] > > -- > http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list