1. Printing and Backtick repr
Printing is the most well-known difference between Python 2 and Python 3. The print statement in Python 2 does not require parentheses; it is a function in Python 3. There is also a difference in the backtick repr. This chapter discusses the polarities of these features between the Python versions and the techniques to achieve their compatibility.
Print
As discussed in this book’s introduction, the print statement in Python 2 became a function in Python 3, which means that we have to wrap the content that we want to print within parentheses. Before we start converting some ...