arrays in python
bsk16 at case.edu
Wed Sep 23 19:24:38 CEST 2009
On Sep 23, 2009, at 1:16 PM, Rudolf <yellowblueyellow at 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 =
> 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
[str(x) for x in xrange(100)]
More information about the Python-list