Saturday, November 4, 2017

­­GETTING STARTED WITH PYTHON

Today we are going to talk about the various version of python we have. You may be wondering that, how many version of python do we have? The answer to that is “we presently have two version of python which are Python 2 and Python 3”.


Every programming language evolves as new innovations and inventions are come by daily by various inventors and innovators and python case isn’t an exceptional case which lead to the movement from python 2 to python 3. The python developer community have therefore made the language more changeable and powerful.

Most of the changes are hardly noticeable as they are just incremental development of python 2. It should therefore be noted that in some case, python 2 code may not run properly on a system with python 3.


For example, in python 2, to print the first program as with every other language the program “Hello World!”, in the python interpreter we would type the following


>>> print “Hello World”


If we have installed python 2 on our system, the program would execute efficiently. But if we are to be working on a system with python 3 interpreter, a SyntaxError would be raised by our interpreter in the form below


>>> print 'hello world'


  File "<stdin>", line 1


    print 'hello world'


                      ^


SyntaxError: Missing parentheses in call to 'print'


This is not the only changes or migrations involved from moving from python 2 to python 3. There are a lot of such methods which happens to work in python 2 that doesn’t work on python 3. As we progress on this course on this platform some of those migrations would be made mention of.


At this point, I know some of us will be wondering what version of python do I install? I did advice you to move directly to python 3 as it will save you the stress of having to upgrade at a later date because the python community of developers are gradually moving from python 2 to python 3.


If you are already familiar with the python 2 syntax, you can continue on it but I’d advise you to move to the community of python 3. It has a more robust library, methods, reduced complexity etc. you will get to know more as to why you should pick up python 3 as we progress on this page.


Stay up to date with us. You can drop us a comment as well as your email so we can add you to our newsletter to notify you as the course progress.



Share:

0 comments:

Post a Comment