title: How to initialize a series of lists with strings in python?
body: <p>How do I loop over a range of integers, concatenating a string, such as "array" with the iterate of the loop, and initialize a list with the resulting string?  The following single line shows what I want to do, where I get a "can't assign to function call" error.  </p>
  
  <pre><code>for i in range(int(nmat)): eval('array'+str(i)) = []
  </code></pre>
  
  <p>Meanwhile, further down in the code the following code is accepted (provided I comment out the preceding code that caused it to bomb)</p>
  
  <pre><code>eval('array'+str(ct1)).append(array[1:9])
  </code></pre>
  
  <p>However it tells me that the name 'array0' is undefined (since I don't know how to initialize a series of lists in this manner).  Help would be greatly appreciated, thanks.</p>