Run the interpreter interactively by entering python in the shell. Now enter print 'Hello World' followed by the Enter key. You should see the words Hello World as output.
When I mean run the interpreter, Linux users can use the shell as shown in the examples here or use IDLE. Windows users can click on -> -> -> . The Programs menu folder name might be different depending on the version of Python that you have installed.
Example 3.1. Using The Python Interpreter prompt
$ python Python 2.2.3 (#1, Oct 15 2003, 23:33:35) [GCC 3.3.1 20030930 (Red Hat Linux 3.3.1-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print 'hello world' hello world >>>
What you just entered is a single Python statement i.e. you stated to Python that you want to get something done. We use the print operator to (unsurprisingly) print any value that you give it. Here, we are supplying the string Hello World to the print statement which promptly prints it to the screen.
To exit the Python interpreter prompt, press
Ctrl-d if you are using Linux or using IDLE (both Linux and Windows).
Ctrl-z followed by Enter if you are using Windows, especially, the DOS prompt.