Different versions of Python exist. At the moment of creating this book, the most popular versions are Python 2 and Python 3. Python 3 is, as can be expected, an update of Python 2. Python 2 programs are, unfortunately, not completely compatible with Python 3. Since a lot of Python 2 code is still in use, Python 2 is still an active language, and still being maintained.
The reason why Python 3 was created is to resolve a number of inconsistencies and idiosyncrasies in the Python 2 language. For people new to programming, this is a big plus, because there are less “weird” language elements they need to learn and understand if they choose Python 3 instead of Python 2.
To give an example, when you calculate
Since Python 3 is more intuitive than Python 2, and since nowadays most Python programs and modules have been converted to Python 3, this book is written for Python 3. If you ever have to revert back to Python 2, it is not hard to make the change. An overview of the differences between Python 2 and Python 3 is given in Appendix 301 (which is not a complete overview, but contains all the differences that I am aware of). If you are only using Python 3, you can ignore this appendix. However, considering how often I see the question “What exactly are the differences between Python 2 and Python 3?,” and how hard it seems to be to find an answer to that question, I thought it prudent to add it.