Friday 25 October 2013

Python

$ vim helloworld.py

#!/usr/bin/python

# Hello world python program

print "Hello World!";

It is also important that I explain a bit about righting in the languages. This above is a sample of Python programing language, it is the simplest English based language I have come across.
In every program the first thing stated is the name of the file. In this case the name is “helloworld” the bit before it is just saying to the computer that this is the name, and the .py is just saying it is a Python script that can be executed.
Next In python you state where the reader is for the script is on your computer. This does not have to be stated in all languages because in many of the languages the script is written strait into the reader (the reader is the program on the computer that will interpret you code.)
Finaly the last two lines are the body of the code, this is what the reader will be reading and interpreting and this is the bit that makes things happen.


No comments:

Post a Comment