title: double for loops in python
body: <p>I am trying to get a list of file names in order. Something like </p>
  
  <pre><code>files-1-loop-21
  files-1-loop-22
  files-1-loop-23
  files-1-loop-24
  files-2-loop-21
  files-2-loop-22
  files-2-loop-23
  .
  .
  .
  and so on
  </code></pre>
  
  <p>As for testing I have written python code as below:</p>
  
  <p>code sample_1:</p>
  
  <pre><code>for md in range(1,5):
     for pico in range(21,25):
        print md, pico
  </code></pre>
  
  <p>It gives me pair of number such as:</p>
  
  <pre><code>  `1 21
     1 22
     1 23
     1 24
     2 21
     2 22
     2 23
     2 24
     3 21
     3 22
     3 23
     3 24
     4 21
     4 22
     4 23
     4 24
  </code></pre>
  
  <p>`</p>
  
  <p>if I use:</p>
  
  <p>code sample_2:</p>
  
  <pre><code> for md in range(1,5):
     for pico in range(21,25):
    print "file-md-loop-pico"
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>  files-md-loop-pico
    files-md-loop-pico
    files-md-loop-pico
    files-md-loop-pico
    files-md-loop-pico
    files-md-loop-pico
    files-md-loop-pico
  </code></pre>
  
  <p>How (code sample_2) should be altered to get the file lists as I wanted (as shown in the beginning of this post) in python?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards</p>