Python, for easy programming

Python code must be indented
(Monty Python at work )
Python is an interpreted language widely used, one of the easiest to learn and use.
A day is enough to start programming with Python and you can write scripts in a few hours while you need for days with other languages. It has powerful features such as lists, tuples, dictionaries that allow you to translate your ideas into lines of code directly.
The lists are integrated and made it a successor to the Awk and any other word processor language.
There is a version for Windows, Linux and other platforms.
The name is a tribute to the comedy group "Monty Python", but the same name snake is still became the symbol of the language.
Features
- Python is an object oriented, interpreted language.
- Variables are dynamic, the type is not declared and may change.
- Indentation is used for block recognition and this is unic to Python.
- Tuples are variables or object packed all together, for functions' return, for example.
- Lists and dictionaries are other built-in composed objects.
- Functions may be embedded inside other functions.
- Can be extended with C modules.
Python 3
Version 3.0 changes the syntax of the language which makes it partially incompatible with the previous ones.
- print x is replaced by print (x).
- Two types of string, data str and not compatible.
- Lists are replaced by views and iterators.
Sample code
Displaying chars of a string.
s = "demo" for c in s: print c
Displaying elements of a list.
listdemo = [1,2,3] + [4,5]
subdemo = listdemo[1:3]
for num in subdemo:
print num
>>> should print: 2 3 4
Documents and tools
- Python
The official distribution with a complete tutorial. Thank to the installer to download, installation is very easy. - Jython
A Java compatible version. Compile any Python source to bytecode, interpreted by the Java virtual machine. - Unladen Swallow
5 times faster Python, a project from Google. - Zope
Widely used, open source web application server written entirely in Python. - Python in the browser
- Syntax of Python and PHP
All commandes compared.
| Tweet |
|