Friday, November 22, 2019

Difference python2 and python3

Difference python2 and python3
1.python 2 print statement ex,print 'hello'
  python 3 print statement ex,print('hello')

2.python 2 uses raw_input and return string. Need to do
explicit typing
  python 3 uses input(), no explicity casting.

3.Python 2(Implicit string type is ASCII, but python 3 is Unicode

4.python2 has xrange, but its not in python 3

5)as is mandatory in exception concept

No comments:

Post a Comment

Python Challenges Program

Challenges program: program 1: #Input :ABAABBCA #Output: A4B3C1 str1="ABAABBCA" str2="" d={} for x in str1: d[x]=d...