Differences between Python2 vs Python3

Listing out the major features or statements which are having difference between Python 2.x and Python 3.x.

1 ) Print

2) Range functions

3) Strings

4) division operator

5) feature module

6) Exception handling

7) input function

8) object return type for some of inbuilt functions

Detailed description

Print function

Python 2.x->

print ‘Hello Welcome’

Python 3.x->

print(‘Hello Welcome’)

Note: In Python 3 print should be use like function

Range function

combining both range and xrange in Python 2.x will make range in python 3 with xrange behavior.by default python 3.x range provides iterators object.


In Python 2.x strings are ASCII but in Python 3.x strings are by default Unicode.

Division operator

In Python if you do division ( 7/5 ) then will get result as 1 but in Python 3 division gives with floating number (like 7/5->1.4).

__feature__ module

Python 3.x feature modules add some extra attributes which are not available in Python 2.x and by using those things we can give backward compatibility for some of python 3.x features


from feature import division

Exception handling
There is a small change in exception handling while using exception block , in Python 3.x you need to be handle exceptions by as keyword.



try block

except error as err:

exception code

Input function

In Python 2.x we have two functions to take inputs from user like input ( depends on user provided value )& raw_input (everything is string) .

to combining these two functions in Python 3.x introduces only input function which takes everything as string.

Object return type for some of inbuilt functions

In Python 2.x some of the inbuilt functions provides list as a output but in Python 3.x all built in functions returns by default iterator object.


zip, map, filter, dictionary keys, dictionary  values, dictionary  items, range


Book for Python Data Structures and Algorithms by Narasimha Karumanchi

While i was searching for Python data structures and algorithms information in google, found interesting and well explained book which has written by Mr Narasimha Karumanchi. This Book has explained each topic with examples and explanation.As for author concern, this book is very helpful those who are trying to get jobs in Tier 1 companies like ( Facebook , Google, LinkedIn….).

Core Python Programming book by R. Nageswara Rao.

A Nice book for Python Core programming,  has written by Indian author R. Nageswara Rao.

This book provides all the concepts from simple to complex  with examples and it was mainly intent for students but not limited even professional can benefit by referring this book.

Currently this is book is available in Amazon with two formats (digital, Paper back)

Link for amazon book directory.


Data Structures and Algorithms Implementation in Python:

Found an interesting Python’s third party module for implementing Data Structures and Algorithms in Python.

But it may not apt for real time production.

Get the module from below location


Get the Usage documentation from the below link


API Testing with Python (Requests Module).

What is API Testing?

API testing is a type of software testing which involves testing application programming interface or software resource as part of product integration testing to determine if they meet expectations or functionality, reliability, performance, and security.

What are types of API?

Simple Object Access Protocol (SOAP)

Remote Procedure Call (RPC)

Representational State Transfer (REST)

Out of above three, last one has become now industry standard API implementation with many feature ready standards and also it has support for many programming languages.

Python Request Module for testing API

Request is a Python Module for testing application programming interface with features of get , post, put and delete.

The Requests module is a an elegant and simple HTTP library for Python.

Simple Example:-

Make a Request

import requests

r = requests. get (‘https://api.github.com/events’)

r = requests.post (‘https: //httpbin.org/post’, data = {‘key’:’value’})

r = requests. put (‘https://httpbin.org/put’, data = {‘key’:’value’})

r = requests. delete (‘https://httpbin.org/delete’)

r = requests. head (‘https://httpbin.org/get’)

r = requests. options (‘https://httpbin.org/get’)

r = requests. options (‘https://httpbin.org/get’)

# Passing Parameters in URL

payload ={‘key1’:’value1’,’key2’:’value2’}

r = requests. get (‘https://api.github.com/events’, params=payload)

# Response Content

r = requests. get (‘https://api.github.com/events’)


[{u'repository': {u'open_issues': 0, u'url': 'https://github.com.....]



r.encoding = ‘ISO-8859-1’

# JSON Response Content

r = requests. get (‘https://api.github.com/events’)


[{u'repository': {u'open_issues': 0, u'url': 'https://github.com.....]

For Complete Requests Module  Reference, Check the below links.



Why Python is getting popularity (famous) ??

Introduction About Python:

Have you ever come across word the Python anywhere? If no, let me brief you about “Python”. Python is an interpreted, object oriented and high level programming language more over it has built in data structures which makes it attractive for rapid application development as well suitable for scripting language. The applications of python languages are wider it used to create GUI based desktop applications, web applications , business applications and Automation.

Advantages of Python:

Python has numerous third party modules which make it capable for interacting with other language and platform

Python is open source software which makes it free to use and distribute

Python provides excellent readability which helps beginners to learn the language fastly

Python offers user friendly data structures

Python increases the speed of application development

According to survey Python is popularly used programming language for data scientist across the globe. It is second widely used programming language next to java more over most of the IT companies have adopted Python as their programming language and number companies using Python are increasing rapidly which would create large job opportunities.

Language Ratings:





Link to original source:


Set Python Environment Variable in Windows.

Some times after installing Python, you  may face issue like.

‘Python’ is not recognised as internal or external command,


Solve the issue by fallowing below step by step procedure on the windows.

1 ) Right click on My Computer  open the option Properties.then you will find advanced system settings option then click on it.


2) After clicking advanced setting link will find new tab with Environment variables tab click on it.

img3 img4

3) Copy the Python installation path, default path would be (C:\Python27).Then click the edit button of user variable settings and paste the path here.and repeat same for system variable also.

img5 img6

4) Then put the OK and come out from screens open fresh command prompt then try python installation.



This is not for all the cases i.e ideally path should be set automatically . some times due to our system settings it wan’t happen then without any doubts apply the above steps and come out form the issue and do actual work .