4 Reasons to learn Python


The four main reasons to learn python programming language are as follows:

 

1.     Simple Elegant Syntax

 Python has a very simple and easy to understand syntax that makes the user able to learn the language more efficiently. As an example, suppose that you want to add two numbers and then want to print the sum of the two numbers then you will use the following syntax:

X = input()

Y = input()

sum = X + Y

print(sum)

 In the above there is a simple addition function that takes two input variables X and Y and adds both numbers storing it to another variable sum and then printing the sum of the two variables. It can also be seen in the above example that there is no need of punctuation marks like semi colon that was necessary in C++ programming language. This proves that python programming is not strict.

 

2.     Not overly Strict

Consider the following example in which two numbers are added and then printed:

X = input()

Y = input()

sum = X + Y

print(sum)

You have observed that the variables are not declared or defined meaning that their data types are not specified and they still can be used. This is states that python is not a strict programming language. There is no need of punctuation marks like semi colon that was necessary in C++ programming language at the end of the statements. This proves that python programming is not strict. This makes learning and using the programming language much easier.

 

3.     Expressiveness of the language

The lines of code are less in python programming language yet solving a complex problem. Hence the python programming language is expressive. For example a code of a game like pacman takes a large number of lines of code but this problem is solved in python and it takes a smaller number of lines of code.

 

4.     Great community and Support

Everywhere there are user groups in which various users share their experiences with python and also share new ideas. These users groups are mostly in every city and you should join these groups. If a user is facing any problem than he can contact to the python community, there is a large python supporting community that may include:

Learn Python subreddit, Google forum for Python, Python Questions- Stack Overflow.

 

Difference between Python version 2 and Python version 3

If the user wants to start a new project then he can start we any of the two because both versions of python support standard libraries that you are going to use. The main difference between Python 2 and Python 3 is the print statement. The difference is that much that a script written with print statement of python 2 cannot be run on the version 3. The print statement is replaced by print () in python 3 and it is written as print “” in python 2. To understand this, consider the following example:

Print statement in PYTHON 2

Suppose you want to display Hello World then the print statement for this will be as given below in python 2:

print “Hello World”

Print statement in PYTHON 3

Suppose you want to display Hello World then the print statement for this will be as given below in python 3:

print (“Hello World”)