title: Running nested for loops without repeating variables?
body: <p>Is there an efficient way to run nested for loops, avoiding any of the counters having the same value. Obviously, I could run some if statements, as below, but is there a more efficient way?</p>
  
  <pre><code>for i = 1 to 20:
      for j = 1 to 20:
          if (i == j):
              continue
          else:            
              for k = 1 to 20:
                  if (i == k) or (j == k):
                      continue
                  else:
                      do something useful with these different numbers
  </code></pre>
  
  <p>EDIT: The variables are not interchangeable, so [2, 1, 0] is different to [0, 1, 2]. The "do something useful" will be about 6 numerical checks on the numbers, involving adding, squaring, and square rooting them.</p>
  
  <p>Thanks, and sorry about the possibly unusual pseudocode (and the constant editing).</p>