There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Within the learn.pp folder, we will create a virtual environment called learnpp."
A block of code is set as follows:
# we define a function, called local
def local():
m = 7
print(m)
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
# key.points.mutable.assignment.py
x = [1, 2, 3]
def func(x):
x[1] = 42 # this changes the caller!
x = 'something else' # this points x to a new string object
Any command-line input or output is written as follows:
>>> import sys
>>> print(sys.version)
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "To open the console in Windows, go to the Start menu, choose Run, and type cmd."