Skip to content
Anusha muppalla edited this page Aug 23, 2019 · 4 revisions
                                               Icp1

Question-1: Difference between python 2 and 3 versions?

  1. In python 2.x version the strings are stored as ASCII by default, in python 3.x version the strings are stored as Unicode by default.
  2. In python 2.x version the calculation rounds to a nearest whole number where as in python 3.x version it rounds to a exact integer. Example: 5/2 = 2 - python 2 5/2 = 2.5 – python 3
  3. In python 2.x version, simply we can print “hello”, whereas in python 3.x version we should write print(“hello”). 4.In error handling for python2.0v, there is no need to use “AS” keyword whereas, In python 3.xv we should use “AS” keyword in except statement.

Clone this wiki locally