What is Python? Things to know before code with Python


What is Python?

Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, and the source code is also available under the GNU General Public License (GPL). It is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.

History of Python

Python was developed by Guido van Rossum in the late eighties and early nineties at the National Research Institute for Mathematics and Computer Science in the Netherlands. It is derived from many other languages, including ABC, Modula-3, C, C++, Algol-68, SmallTalk, and Unix shell and other scripting languages. Python is copyrighted. Like Perl, Python source code is now available under the GNU General Public License (GPL). It is now maintained by a core development team at the institute, although Guido van Rossum still holds a vital role in directing its progress.

Python, named after the British comedy group Monty Python, is an interpreted, interactive, object-oriented programming language. Its flexibility allows it to do many things, both big and small. It can be used to write simple programs, but it also possesses the full power required to create complex large-scale enterprise solutions.

Some of the ways in which Python is used and it includes:
  1. Desktop graphical application development, including games;
  2. Mathematical and scientific analysis of data; and,
  3. Web and internet development.

Python’s presence in the world of computer programming can be found everywhere. For example, it is used in some of the largest internet sites on earth – like Reddit, Dropbox, and Youtube, to name a few. The popular Python web framework Django powers both Instagram and Pinterest. LucasFilm’s award-winning visual effects company, Industrial Light & Magic, uses Python to make help make their magic come to life.

It’s easy to forget just how powerful Python is because it’s so easy to learn.

What is Python Things to know before code with Python

Python Properties

Python is…

  • Strongly typed – It enforces data types so you can’t concatenate a string and an integer,
  • Dynamically, implicitly typed. So, you don’t have to explicitly declare variable data types. Data types are enforced at runtime.
  • Case sensitive – For example, token and TOKEN are two different variables.
  • Object-oriented – Everything is an object. It supports functional and structured programming methods as well as OOP.
  • Interpreted − It is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP
  • Easy-to-learn − Python has few keywords, simple structure, and a clearly defined syntax. This allows the student to pick up the language quickly.
  • Easy-to-read − Python code is more clearly defined and visible to the eyes.
  • Easy-to-maintain − Python’s source code is fairly easy-to-maintain.
  • A broad standard library − Python’s bulk of the library is very portable and cross-platform compatible on UNIX, Windows, and Macintosh.
  • Interactive Mode − Python has support for an interactive mode which allows interactive testing and debugging of snippets of code.
  • Portable − It can run on a wide variety of hardware platforms and has the same interface on all platforms.
  • Extendable − You can add low-level modules to the Python interpreter. These modules enable programmers to add to or customize their tools to be more efficient.
  • Databases − It provides interfaces to all major commercial databases.
  • GUI Programming − It supports GUI applications that can be created and ported to many system calls, libraries and windows systems, such as Windows MFC, Macintosh, and the X Window system of Unix.
  • Scalable − It provides a better structure and support for large programs than shell scripting.
Apart from the above-mentioned features, It has a big list of good features, few are listed below −
  • It can be used as a scripting language or can be compiled to byte-code for building large applications.
  • Provides very high-level dynamic data types and supports dynamic type checking.
  • Supports automatic garbage collection.
  • Can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
  • Great language for the beginner-level programmers and supports the development of a wide range of applications from simple text processing to WWW browsers to games.

It is free, open-source software that works on Linux, Mac, Windows, and various other platforms (21 in total). It comes preinstalled on Mac and most distributions of Linux; however, you may need to download the latest version (click here). To check your version, open the terminal and run the command python -V.

How to Choose a Python Version?

It can be confusing for both new and seasoned programmers on deciding between Python 2 or 3. Fortunately, there are few syntactical differences between the two and you can run both versions on your computer.

Currently, there are two main versions of python

  1. 2.x
  2. 3.x.

Only version 3.5.x is in active development, in terms of gaining new features and functionality, while Python 2.7.x, as well as 3.2.x to 3.4.x, are actively maintained.

Which version is right for you?

Well, that’s up to you. Honestly, there are few differences between the two that will affect you at this early stage, so either choice will suffice. Plus, once you’ve learned one, it’s not too difficult to learn the other.

In general, if you’re just starting to learn, go with 3.4.x, since it’s a better version as there are added features along with plenty of bug fixes and refinements. However, 2.7x has much more support from third-party libraries. If you know you’ll need to use a library that has not been ported to version 3.4.x, then it may be best to start with 2.7x.

The examples in this series will be shown in version 3.4.2, which is the current version as of writing. That said, most of the examples will work fine with either version since many of the features and updates added to 3.4.x were also added to 2.7.x. We’ll discuss any differences that you should be aware of as they arise.

About the author

Pardeep Patel
Pardeep Patel

Add comment

Pardeep Patel By Pardeep Patel

Basics of Python