I'm sure this question has been asked before but I couldn't find it.
As part of a pretty simple programming problem in a homework assignment, I've been told I need to loop 10^8 times. But any time I try to loop that many times my program (and whole computer) hangs.
Since this is for a homework assignment, I won't share my actual code, but even this really basic script hangs on my computer:
for i in range(10**8):
... j = i
10^7 loops works fine. 10^8 always hangs.
I'm not a new python user but I'm not sure how to diagnose this. Is it a memory-related issue? What are some strategies for fixing that? Is it just a limit in Python?
I'm using Python 2.7 if that's relevant.
(Also, for the record, the homework assignment has nothing to do with solving this problem. N=10^8 is just what my professor randomly chose.)