Python (programming language)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Python
Python logo and wordmark.svg
Designed by Guido van Rossum
Developer Python Software Foundation
Stable release 3.6.4 / 16 December 2017; 5 months ago (2017-12-16)[1]
2.7.14 / 16 September 2017; 8 months ago (2017-09-16)[2]
Platform Any
OS Any
License Python License[3]
Filename extensions .py, .pyo, .pyc
Website https://www.python.org

Python is an open source programming language that was made to be easy-to-read and powerful. A Dutch programmer named Guido van Rossum made Python in 1991. He named it after the television show Monty Python's Flying Circus. Many Python examples and tutorials include jokes from the show.

Python is an interpreted language. Interpreted languages do not need to be compiled to run. A program called an interpreter runs Python code on almost any kind of computer. This means that a programmer can change the code and quickly see the results. This also means Python is slower than a compiled language like C, because it is not running machine code directly.

Python is a good programming language for beginners. It is a high-level language, which means a programmer can focus on what to do instead of how to do it. Writing programs in Python takes less time than in some other languages.

Python drew inspiration from other programming languages like C, C++, Java, Perl, and Lisp.

Python has a very easy-to-read syntax. Some of Python's syntax comes from C, because that is the language that Python was written in. But Python uses whitespace to delimit code: spaces or tabs are used to organize code into groups. This is different from C. In C, there is a semicolon at the end of each line and curly braces ({}) are used to group code. Using whitespace to delimit code makes Python a very easy-to-read language.

Python use[change | change source]

Python is used by hundreds of thousands of programmers and is used in many places. Sometimes only Python code is used for a program, but most of the time it is used to do simple jobs while another programming language is used to do more complicated tasks.

Its standard library is made up of many functions that come with Python when it is installed. 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; it can do many different things.

Some things that Python is often used for are:

  • Web development
  • Game programming
  • Desktop GUIs
  • Scientific programming
  • Network programming.

Example[change | change source]

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 does something called "dynamic variable assignment". This means that when a number or word is made in a program, the user does not have to say what type it 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)

In a "statically typed" language like C, a programmer would have to say whether x was a number or a word before C would let the programmer set up x, and after that, C would not allow its type to change from a number to a word.

References[change | change source]

  1. Deily, Ned (19 December 2017). "Python 3.6.4 is now available". Python Insider. The Python Core Developers. Retrieved 27 December 2017. 
  2. Peterson, Benjamin (16 September 2017). "Python 2.7.14 released". Python Insider. The Python Core Developers. Retrieved 17 September 2017. 
  3. "Python legal statements". Python Software Foundation. Retrieved January 28, 2012. 

Other websites[change | change source]