This is the code for my Python book.