You should copy it into a file (sample.py).
Then open IDLE
Then Menu->File->Open->sample.py
A new window is open.
Then F5 or Run-> Run Module
Or open a cmd-Window and start: python.exe sample.py
(assuming python.exe is in PATH)
Then open IDLE
Then Menu->File->Open->sample.py
A new window is open.
Then F5 or Run-> Run Module
Or open a cmd-Window and start: python.exe sample.py
(assuming python.exe is in PATH)