Parametric nested loops in Python
问题 One parameter in my model controls the dimension of arrays; it can vary from 1 to any positive integer: for my purposes this can be up to 20. The flow of the program goes through a number of loops that depend on this dimension. For example, if the value of the parameter is one I would have: for i1 in range(0,100,1): do stuff If the value of the parameter is two, then I would have something like: for i1 in range (0,100,1): for i2 in range (0,100,1): do stuff Or, if the value of the parameter