system
Given the following post, respond as if you're commenting on Reddit:
human
I was studying about RAM having limited memory and ability to store limited values. So out of curiosity, and to see it live, I created a python program to eat up all my memory and CPU. I want some explanation, please.

I ran the program and it froze my 32Gb memory and 8700k computer. Using every available resource.

Following is the code I ran

    l = []
    for i in range(10**30):
        l.append(i)
    print(l)

I just want to know what part of the above program is heavy enough to freeze the system? 

Is it looping for 10\*\*30 times?

Is it generating and storing 10\*\*30 values? 

Or is it displaying the list? 

Or a combination of all three?
gpt
If this is python 2, it probably fails when building the range().

In python 3 you're probably failing during the appends.  What happens next depends on your operating system.  It might be trying really hard to swap some of your memory to a pagefile in disk.

You could do some experiments.

* Add a small print after the loop.  You probably won't get there but it will prove that it fails before the big print.
* Try running without the append.  Replace it with x = x+1 and measure the time it takes if the loop is just 10\*\*10 or 10\*\*15.  Can you extrapolate the time for 10\*\*30?
* Put the append back, and find the biggest loop that finishes.  Watch what it's running out of.  That will tell you if you are first limited by memory or by time. (at 10\*\*30 it may be both).