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.
for i in range(int(nmat)): eval('array'+str(i)) = []
Meanwhile, further down in the code the following code is accepted (provided I comment out the preceding code that caused it to bomb)
eval('array'+str(ct1)).append(array[1:9])
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.