Wednesday, 8 January 2014

The first program with explanation

Traditionally, the first program you write in a new language is called “Hello, World!” because all it does is display the words, “Hello, World!” In Python, it looks like this:

>>>print ("python is fun")
python is fun

This is an example of a print statement, which doesn’t actually print anything on paper. It displays
a value on the screen. In this case, the result is the words

python is fun

The quotation marks in the program mark the beginning and end of the text to be displayed; they don’t appear in the result. Some people judge the quality of a programming language by the simplicity of the “python is fun!” program. By this standard, Python does about as well as possible.

No comments:

Post a Comment