days
1
1
hours
0
7
minutes
4
4
seconds
5
6
Python basics

Why learn Python?

Krishna Rungta
Code image via Shutterstock

If you’re thinking of taking a deeper look at Python, you’ll first need some answers. What’s it like to program with Python? What scenarios does it work best in? And where is it better than competitors like Ruby, Java and C++?

Python is a high-level, interpreted, object-oriented programming language with dynamic semantics. It was first introduced in late 80s by Guido Van Rossum. The language is designed in easy to learn syntax frequently used with English keywords, where other languages use punctuation.

Let’s take a look at a more detailed comparison of Python with other programming languages. Python’s syntax pattern and certain features are directly implemented from ABC (programming language). Many popular companies like Google, Twitter, Facebook, Quora, Pinterest, Instagram, etc. use this language. In fact Python is one of the Google’s top priority languages, and they have built many popular products with it.

Python Version history

  • The first version of Python code published was version 0.9.0 at alt.sources in February 1991
  • The second version (version1.0) was released in January 1994
  • The third version (version 2.0) was released in 2000 followed by the last version (version 3.00), released in 2008.

Screen Shot 2015-08-31 at 15.45.10Python language can be used in various CS fields

  • For developing games
  • For scientific programming
  • Artificial Intelligence

According to codeval.com research, Python was the most popular language in 2014.

There are mainly two versions of Python in circulation Python 2.7 and Python 3.2. Python 2 has better third-party support while Python 3 is the main focus of the developers designing the language.

SEE ALSO: Comparing language rankings and radars

Python features

  • Python requires a minimum setup. On a Mac find your terminal program and open it. For PC find the PowerShell program and access it. If Python is not recognised, you can download Python.
  • Identifying errors in Python and fixing them is very easy. This is because Python show errors at the run time, instead of simply failing to compile the program.
  • Screen Shot 2015-08-31 at 15.45.35

    Python is the #1 language in the codeeval ranking

    Python is the main programming language for the Raspberry Pi microcomputer. The open-source community behind Python is very active and it continues to improve its features.

  • The bundle IDLE in Python makes Python easy to write and run the programs. It has a syntax highlighting which means text will highlighted according to the category within your program.
  • Python gels well with other languages. You can also call MATLAB functions from Python.
  • Python incorporates function, class, module and method documentation directly into the language itself.
  • Python has rich data structures like dictionaries, strings, tuples, lists and sets, which is very useful for algorithms.

Python vs Ruby

Let’s compare Python to its close competitor Ruby to why it can be useful to use Python.

Python

Ruby

  • Python has clean syntax that resembles English and does not have strict case-convention
  • In Ruby, everything is an object. There are some enforced case-conventions (eg: variables start with a lowercase letter)
  • In Python, you don’t have a reference to the class until after the class construction is finished
  • In Ruby, you have a reference to the class (self) already in the class body
  • Compared to Ruby, the updates are less painful and less frequent
  • Updates are not as simple as in Python
  • Python prevents modification of built-in classes
  • Ruby allows the modification of built-in classes
  • Python is stronger in areas like system administration, data manipulation, analytics, system administration, etc.
  • Ruby is stronger in areas like writing a web application, scientific programming, etc.
  • Debugging is very easy
  • In Ruby, strings are mutable

SEE ALSO: What is a function in Python?

This Python tutorial series was provided by Guru99 – hands-on tutorials for programming languages.

Author
Krishna Rungta
Krishna Rungta is founder and CEO of Guru99, a learning-by-practice tutorial website for programmers.

Comments
comments powered by Disqus