Python (programming language)
- This article is about the programming language, the article about the snake is at python
![]() |
|
Stable release | 3.3.0 / September 29, 2012 2.7.3 / April 11, 2012 |
---|---|
Operating system | Any |
Platform | Any |
License | Python License[1] |
Website | http://www.python.org |
Python is an open source programming language that was made to look good and be easy to read. It was created by a programmer named Guido van Rossum in the year 1991. The language is named after the TV show Monty Python and many examples and tutorials include jokes from the show.
Python is an interpreted language. An interpreted language allows the programmer to give the source code to the computer and the computer runs the code right away. This means if the programmer needs to change the code they can see the result of any changes quickly. This makes Python a good programming language for beginners and for rapid development because unlike some compiled languages you do not have to go through the Compile-Build-Run-Debug cycle with Python. But because the computer has to figure out what the code does each time, it is a very slow language. Sometimes, it can be 200 times slower than C.[source?]
Python is a high-level programming language. A high level language has advanced features which allow the programmer to write instructions without having to worry about how the computer is going to carry them out. This makes writing programs easier and faster. Python derives some of its syntax from C and can use modules written in C.
Contents |
[change] Syntax
Python has a very easy to read syntax. Some of it comes from C, because that is the language that Python was written in. The main thing different with Python is that at the end of each line, a semicolon is not needed. Also, there are no curly braces ({}), which are common in C. Instead, Python forces people to press tab to organize their codes. This makes it a very easy to read language.
[change] Usage
Python is used by hundreds of thousands of programmers and is used in lots of applications. Sometimes only Python code is used for a program but most of the time it is used to do simple tasks while another programming language is used to do the more complex tasks.
Its standard library is what functions come with the program when it is installed. The standard library has lots functions in it. On the Internet there are many other libraries available that make it possible for the Python language to do more things. These libraries make it a powerful language meaning that it can do lots of different things.
Some things that Python is often used for are:
- Web development
- Game programming
- Desktop GUIs
- Scientific programming
- Network programming.
[change] Example
This is a small example of a Python program. It shows Hello World! on the screen.
print "Hello world!" # This code does the same thing, only it is longer: ready = True if ready: print "Hello world!"
Python also has a very easy feature called "dynamic variable assignment." This means that when a number or word is created in a program, the user does not have to say what that is. This makes it easier to reuse variable names, making fast changes simpler. An example of this is shown below. This code will make both a number and a word, and show them both, using only one variable.
x = 1 print x x = "Word" print x
[change] References
- ↑ "Python legal statements". Python Software Foundation. http://www.python.org/about/legal/. Retrieved January 28, 2012.
[change] Other websites