title: Adding an item at specific intervals in list (Python)
body: <p>Basically my problem is this:</p>
  
  <p>I have a list containing integers. In this case, the integers reflect greyscale values for individual pixels. I've established a variable (xpixel) that is the width of the photo in pixels. When my list hits this number (Just after the xpixel-1 pixel integer) i need to add a special identifying character to signal that the line of pixels has been completed and to begin the next line. This continues at intervals of xpixel through the entire integer string.</p>
  
  <p>So, how do i add an item to my list at exactly that given interval?</p>
  
  <p>Something like this?:</p>
  
  <pre><code>j=0
  for i in Pixels:
      if j%xpixel==0 and j!=0:
          pixel_corrected.append(i)
          pixel_corrected.append('END PIXEL LINE')
          j+=1
      else:
          pixel_corrected.append(i)
          j+=1
  </code></pre>
  
  <p>Thanks in advance for the help.</p>