small medium large xlarge

The latest version of the book is P3.0, released over 1 year ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (10-Jun-14)
  • Fixed: 14-Aug-17, awaiting book release
#76854
PDF page: 1

Would it be possible or desirable to provide the Exercise Solutions in a PDF or some other easily printable form? --David @ Support

Jason Montojo says: There's now a link to the LaTeX version of the solutions (from which you can generate a PDF) from the main solutions wiki page.
  • Reported in: P2.0 (18-Dec-15)
  • Fixed: 21-Jul-17, awaiting book release
#79352
Paper page: 11
It says "With // , the result is rounded down to the nearest whole number", when in reality it returns the floor of the normal division beetween the f...more...
Jennifer Campbell says: Thanks for reporting this. We are working on the third edition of the book and I was trying to address this, but I believe our wording is okay as is. We say "rounded down", not just "rounded".
  • Reported in: P3.0 (01-May-16)
  • Fixed: 10-Aug-17, awaiting book release
#80283
PDF page: 24

((350-32) x (5/9)) /20 = 8.83333333333333 rather than 7.83333333333333 for oven-heating time.

--George Richards

Jennifer Campbell says: In the expression above, you forgot to subtract 20: >>> (((350-32) * 5 / 9) - 20) / 20 7.833333333333333
  • Reported in: P3.0 (01-May-16)
  • Fixed: 10-Aug-17, awaiting book release
#80284
PDF page: 24

Erratum submitted in error. (-20) missing from numerator which changes result from 8.833.... to 7.833.... My apologies.--George Richards

  • Reported in: P1.0 (07-Dec-16)
  • Fixed: 10-Aug-17, awaiting book release
#80959
PDF page: 62

the first line:
`Reading the code, if someone calls pie(0) , then you probably see that this will`

pie(0) should actually be `pie_percent(0)`.

Paul Gries says: Thanks for this, we'll update this in the third edition.
  • Reported in: P3.0 (26-Jan-17)
  • Fixed: 14-Aug-17, awaiting book release
#81079
PDF page: 76

In Chapter 4 - Working with Text Answer 5a and 5b rabbit has too many "b's"
rabbbit should be rabbit.--Michael Birnbaum

Jason Montojo says: Thanks for catching this! We've updated the solutions.
  • Reported in: P3.0 (05-Dec-16)
  • Fixed: 26-Jul-17, awaiting book release
#80952
PDF page: 85
I've purchased the book and I believe I have found an editing error. It's in Chapter 5.1 A Boolean Type, p 85, "Comparing Strings" (2nd paragraph). It...more...
Jennifer Campbell says: Thanks for reporting this issue. There was a formatting problem that hid some text. This will be fixed in the third edition of the book.
  • Reported in: P3.0 (07-Oct-16)
  • Fixed: 03-Aug-17, awaiting book release
#80791
Paper page: 103
I'm using PY3.5.2. in the grey example "Restoring a Module," I tried to follow the steps in my Shell. The math=imp.reload(math) line does not reset p...more...
Jennifer Campbell says: Thanks for reporting this. As you point out, imp.reload is deprecated and has been replaced. Also, Python treats system modules and user-defined modules differently, and we will update this section in our third edition.
  • Reported in: P3.0 (07-Oct-16)
  • Fixed: 13-Aug-17, awaiting book release
#80792
Paper page: 111
Figure 4-The doctest Module Running the Tests from Module temperature_program is the wrong snapshot... it is showing a test of the baking.py program n...more...
Jason Montojo says: Thanks for catching this! Yes, the figure doesn't match the text. We'll have this fixed in the next edition.
  • Reported in: P3.0 (07-Oct-16)
  • Fixed: 13-Aug-17, awaiting book release
#80793
Paper page: 113
Figure 6--Failure Message for doctest is showing test result from the baking.py program and not the described temperature_program.py module. The expla...more...
Jason Montojo says: Thanks for catching this one too! We'll have it fixed in the next edition.
  • Reported in: P1.0 (22-Nov-13)
  • Fixed: 10-Aug-17, awaiting book release
#53199
Paper page: 174
(in "The with Statement" section) A misleading oversimplification is given re. the purpose of the 'with' statement in Python: The book states that it...more...
Paul Gries says: Thanks for this. We've addressed this as we write the third edition.
  • Reported in: P2.0 (17-Nov-16)
  • Fixed: 10-Aug-17, awaiting book release
#80891
Paper page: 183
Current statement in the book, p2.0 page 183, will result error message (ValueError: could not convert string to float: ). Suggest to add one line to ...more...
Paul Gries says: I understand your question, I think. This is subtle: the first parameter, input_file, is an open file, while the second parameter, output_filename, is a string containing the name of a file.
  • Reported in: P1.0 (26-Sep-13)
  • Fixed: 12-Aug-17, awaiting book release
#52984
PDF page: 186

In function definition smallest_value_skip there is no check for a '-' in the first data line after the header.

Paul Gries says: This is a good point. We omitted this check because we assumed the first value would never be missing — otherwise, the series of values would simply start one later. We have added a clarification about this in the third edition.
  • Reported in: P3.0 (30-Apr-17)
  • Fixed: 12-Aug-17, awaiting book release
#81488
PDF page: 195
Paper page: 185

the return type for smallest_value should be changed to int, not NoneType, as there is an int value being returned

Paul Gries says: Thanks for this, we've addressed it it the upcoming third edition.
  • Reported in: P1.0 (11-Feb-14)
#76399
PDF page: 220
This is not an error in the book, but for the explanation of exercise 5 on page 220 (Storing Data Using Other Collection Types). For the return, yo...more...
  • Reported in: P1.0 (30-Oct-13)
  • Fixed: 12-Aug-17, awaiting book release
#53090
PDF page: 225

In "Find, Remove, Find" it is not the re-insertion that is the problem, but the removal, as min2 is obtained before the re-insertion.

Paul Gries says: Subtle point but valid! Very nice catch. We've updated the short description and the comments in the code in the upcoming third edition.
  • Reported in: P1.0 (02-Dec-13)
#53264
PDF page: 360
Nowhere in this chapter are there instructions to close the connection to the database when you're finished working with it: con.close() Had to ...more...
  • Reported in: P1.0 (07-Feb-14)
  • Fixed: 11-Aug-17, awaiting book release
#76383
PDF page: 371
Paper page: 367
In the index for "backslash", only the meaning of backslash in Windows directory paths is listed (P.174). The use of backslash as line-continuation (...more...
Paul Gries says: Nice catch! We've fixed this in the upcoming third edition. Thanks!