title: How to iterate from 0 to sys.maxint using a for loop in Python
body: <p>I am trying to iterate from 0 to sys.maxint but getting a 'MemoryError'. How should I be doing this ?.</p>
  
  <p>Here is the simple code snippet.</p>
  
  <pre><code>for i in range(sys.maxint):
    a = 1
  </code></pre>
  
  <p>ERROR: Traceback (most recent call last):
    File "", line 1, in 
  MemoryError</p>