FREE ONLINE INTERACTIVE COURSE

Python 3

FOR BEGINNERS

Python 2 vs Python 3
I recommend that you study Python, version 3, because it is modern, better and easier to learn. Version 2.0 was released in 2000, and the latest, 2.7, in 2010, being an extremely popular programming language. Many companies have switched from version 2 to 3 (released in 2008) due to the fact that, in essence, Python 3 is the current one - no one wants to learn or use an outdated language ... Because version 3 is the future, community-developed libraries are of course focused on it. Similarly, many libraries created for version 2 are not compatible with the 3rd, or difficult to adapt.

Once you learn version 3, you will still be able to easily adapt to a project that has already been implemented in version 2.

Read the official recommendations by accessing this [link].

Differences between versions 2 and 3

If in Python 2 the strings were represented by default in ASCII code, version 3 automatically provides Unicode support.

The print function. Although only at the syntactic level, it is a significant change: the print command is in version 3 a function, the call being made by print("Hello!"), unlike version 2 where we simply wrote print "Hello!".

Division.Python 3 is intuitive, as in the case of the split operation, such as 7/2:

Version 2. 7/2 provides the result 3 (rounding).To get 3.5, we have to write 7.0/2.0 (or at least one of the values must be of float type).
Version 3. 7/2 has a direct result 3.5 (float type).
 arrow_back   home   list   arrow_upward