Python Memory Error while iterating to a big range
<pre class="lang-py prettyprint-override"><code>total = 0
x = 2**32
for i in range(x):
    total = total + i;
print(total) 
</code></pre>
<p>I am getting a <code>MemoryError</code> while looping to a range of <code>2**32</code>. Is there any way to do the iteration without running out of memory?</p>