Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

what is the difference between python 2 and 3


    Python 3 syntax is simpler and easily understandable whereas Python 2 syntax is comparatively difficult to understand.
    Python 3 default storing of strings is Unicode whereas Python 2 stores need to define Unicode string value with “u.”
    Python 3 value of variables never changes whereas in Python 2 value of the global variable will be changed while using it inside for-loop.
    Python 3 exceptions should be enclosed in parenthesis while Python 2 exceptions should be enclosed in notations.
    Python 3 rules of ordering comparisons are simplified whereas Python 2 rules of ordering comparison are complex.
    Python 3 offers Range() function to perform iterations whereas, In Python 2, the xrange() is used for iterations.
Source by www.guru99.com #
 
PREVIOUS NEXT
Tagged: #difference #python
ADD COMMENT
Topic
Name
2+1 =