I'm working on a script to find optimum parameters to be passed to a method.I have created a list of possible values of parameters I would like to iterate over, and was wondering if I could avoid writing nested loops for the same.
Here's a rough sketch of the code
param_1 = [1,2,3,5,10]
param_2 = [100,200]
param_3 = [True, False]
param_4 = [True, False]
.
.
for p1 in param_1:
for p2 in param_2:
.
.
do_something(p1,p2,...)
I was wondering how it can be implemented in a better way. I would prefer if in the solution, I can easily shuffle which parameter stays in the outermost loop. etc.