Python 2 vs Python 3
I recommend studying Python,
version 3, because it is modern,
better and easier to learn.
Version 2.0 was released in 2000, and the last one, 2.7, in 2010, being an extremely popular programming language.
Many companies have switched from version 2 to 3 (released in 2008) because, essentially, Python 3 is the current version – no one wants to learn or use a language that is fading... Since version 3 is the future, libraries developed by the community are of course focused on it. Similarly, many libraries created for version 2 are not compatible with 3, or are difficult to port.
Once you learn version 3, you will still be able to easily adapt if you come across a project that has already been implemented in version 2.
Read the official recommendations by accessing the link [
here].
Differences between versions 2 and 3
If in Python 2 character strings were implicitly represented in ASCII code, version 3 automatically offers Unicode support.
Data display. Although only at the syntactic level, it is still a significant change, the
print command in version 3 is a function, so the call is made with
print("Hello!"), unlike 2 where we simply wrote
print "Hello!".
Division. Python 3 is intuitive, as in the case of the division operation, for example, 7/2:
Version 2.
7/2 gives the result
3 (rounding). To get
3.5, you need to write
7.0/2.0 (or at least one of the values should be of
type float).
Version 3.
7/2 directly results in
3.5 (float type).
Python 3 introduces several key differences from Python 2, such as
Unicode support by default for strings,
using the
print function with parentheses, and performing float division with the / operator.
Iterators and many library modules were restructured, and exception handling syntax was updated to use
as for catching exceptions. Additionally, Python 3 removed old-style classes, implicit relative imports,
and functions like xrange() and raw_input().