title: In python, how can I get all the possibilities for input variables?
body: <p>Me and a friend decided that our applescript version of a script was too slow, and ported it to python. </p>
  
  <p>The script is located here: </p>
  
  <p><a href="https://gist.github.com/anonymous/aba4b07237eb2ccec30b" rel="nofollow">https://gist.github.com/anonymous/aba4b07237eb2ccec30b</a></p>
  
  <p>There's a small problem, too many for-loops, and it's not dynamic. Because it's not dynamic the python program reports too many nested for-loops. How can me and my friend avoid this error and possibly enter any number to get the output from the list collections?</p>
  
  <p>I know this can be done somehow with a function, but we're new to python and scripting languages and just trying to push the limits to see what can be done, and learn a little in the process.</p>