June 2018
Intermediate to advanced
398 pages
9h
English
No, you can, of course, write your code in Python 2.x and make it compatible with both versions, but you will need to import a few libraries first, such as the __future__ module, to make it backward compatible. This module contains some functions that tweak the Python 2.x behavior and make it exactly like Python 3.x. Take a look at the following examples to understand the differences between the two versions:
#python 2 onlyprint "Welcome to Enterprise Automation"
The following code is for Python 2 and 3:
# python 2 and 3print("Welcome to Enterprise Automation")
Now, if you need to print multiple strings, the Python 2 syntax will be as follows:
# python 2, multiple ...Read now
Unlock full access