title: python range() in for loop maximum
body: <p>How do I specify a maximum in the range function to that it reverts back to the beginning after a certain number?</p>
  
  <p>i.e:</p>
  
  <pre><code>for i in range(253, 2):
      print i
  
  Would print 253, 254, 255, 0 , 1, 2  
  </code></pre>
  
  <p>If the maximum was 255  </p>
  
  <hr>
  
  <p><strong>Edit</strong> (after reading comments and answers)</p>
  
  <p>This should work right?</p>
  
  <pre><code>if start &lt; end:
      list = [ i for i in range(start, end + 1 ) ]
  else:
      list = [ i % 256 for i in range(start, end + 256 + 1 ) ]
  </code></pre>
  
  <p>Looking back at this, people seem to love complexity over simplicity. Why use itertools and other complicated constructs when it can be done with a simple loop?</p>