Skip to content

What is Python

Python is a high-level, general-purpose, interpreted, dynamic-typed, object-oriented, multi-paradigm programming language.

NOTE

Everything in Python is an object

Why the name 'Python'

When Guido van Rossum was working on Python, he was fond of a BBC Comedy TV Series - Monty Python's Flying Circus. He wanted to give his programming language a name that was unique, mysterious and short, and decided to name it Python after Monty Python's Flying Circus.

Brief History
  • Python 1 was introduced in 1991 and released to public in 1994.
  • Python 2.0 was announced on 28 Oct 2000.
  • Python 3.0 was released in Dec 2008, to rectify the fundamental design flaws of the language but wasn't backward compatible - The guiding principle of Python 3.0 is "Reduce feature duplication by removing old ways of doing things".
    • Python 3 is also referred to as Python 3000.
  • Python 2.7 was released in July 2010 - This was released to bring new features of Python 3.x to Python 2.x.
    • Python 2 was deprecated on 1st Jan 2020 (It was maintained until then since a lot of systems were using Python 2.x and users were given time to migrate to Python 3.x).

Why Python

  • It is Free (Open Source Software).
  • Easy to learn. It's a beginner-friendly programming language. It needs only a fewer lines of code, when compared to some other languages, to achieve something.
  • Portable - Python can be run on almost all types of operating systems (Even the play-stations support Python). And the code that is written is platform-independent. That is, code written on one operating system, can be executed on any other operating system as long as it has the Python Virtual Machine available.
  • Powerful - Python has vast number of libraries, both that come built-in and also third-party, that you can do most of your complex tasks with just a single line of code.
  • Extensible - With Python, you can easily integrate with other programming languages such as Java, C, .Net. You can also invoke their libraries if you wish.
  • There are Python frameworks available for almost everything - such as Web and Desktop apps development, Machine Learning, Internet of Things, games, and more.

Although Python is a high-level language, it provides the ability to access operating system at a lower level, if one desires.

And although Python is considered an interpreted language, it includes a compilation stage that translates the raw-text Python script into a series of bytecodes (.pyc files), which are then executed by the Python Virtual Machine. The use of compilation and bytecode stages helps improve performance and makes Python much faster than pure interpreters such as BASIC, but slower than truly compiled languages such as C and Pascal. The byte-code generated is platform-independent just like the bytecode produced by Java.


Classification of Programming Languages

Depending on the context, programming languages can be classified into various categories.

Level of Abstraction

Depending on how well a programming language isolates a user from the underlying operating system, there are classified into high-level or low-level. Before going further, you first need to understand that the level of abstraction for high-level or low-level languages is not fixed and is subjective. That's why, you often hear different views from different people.

High Level Programming languages

  • These are the programming languages that provide high level of user abstraction from underlying operating systems.
  • The advantages with these type of languages are - it is human-readable, easy to develop (and faster), no need to worry about OS level stuff like memory management.
  • Most programming languages, you would hear about today, are high-level programming languages.

NOTE

Source Code: High-level human readable code is referred to as source code.

Low Level Programming languages

  • These are the programming languages that provide low level (or none at all) of user abstraction from underlying operating systems.
  • These are used for writing machine-friendly code and thereby highly optimized for that machine.
  • These languages (depending on what you consider low-level) don't have an overhead of compilation/translation (see below on what a compiled code is) step and can be directly executed by the machine/computer.

Because the level of abstraction is not defined properly and is subjective, some people consider Assembly language to be low-level, since it's very closer to the machine code despite some level of abstraction. While some people consider it to be high-level, since it can't be directly executed by computer and need an assembler to convert it into machine code first. That is, there are no clear rules to differentiate between high and low level languages.

So, to avoid confusion, you can stick to the following:

  • Machine code, that can directly run by the computer, is a low-level language.
  • Human-readable code (with high level of abstraction) that needs to be compiled/translated, for the machine to be able to execute it, are high-level languages. Ex: Java, Python etc.
  • Anything in between, that is not very clearly low-level or high-level such as Assembly language are mid-level programming languages.