title: Is there a better way to loop through six ranges?
body: <p>I have code that looks like this:</p>
  
  <pre><code>for p in range(15):
      for q in range(5):
          for d in range(3):
              for sp in range(3):
                  for sd in range(2):
                      for sq in range(2):
                          ...
  </code></pre>
  
  <p>It's going to use those six numbers to build two sets of tuples (<code>foo = my_func(x=(p,d,q), y=(sp,sd,sq))</code>) that get passed to a function in order to test the rests each time and find the best results for a given set of six parameters. What I have above will work, but maybe there's a more compact way to do it, perhaps with an external library?</p>