Friday, December 10, 2010

Hello World!

Every computer book has one, so let's get this out of the way.


Start the Python interpreter. You should see the ">>>" prompt.


Here's Hello World in Python.

>>> print "Hello World!"
Hello World!

The ">>>" represent the prompt in Python.


Explanation:
the print keyword instructs Python to display the string that follows. A string in Python is a sequence of characters, enclosed in quotes. The quotes can be single quotes, or double quotes. In the example above I use double quotes.