You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anusha muppalla edited this page Aug 23, 2019
·
4 revisions
Icp1
Question-1:
Difference between python 2 and 3 versions?
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.
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
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.