small medium large xlarge

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 .

• 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: P3.0 (11-Jul-18)
#83364
Paper page: 10
Near bottom of the page, is the statement - "If you want, you can omit the zero after the decimal point when writing a floating point number:" The ans...more...
• 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 (14-Jul-18)
#83366
Paper page: 18
On page 18, first full paragraph, you state variable degree_celsius when it should be degrees_celsius as in the preceding examples. (degree_ vs degree...more...
• 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 (16-Jul-19)
#85583
PDF page: 107
Hi, The error is in the pdf of the answers of the exercises from chapter 5, not in the pdf of the book. There are answers to only 5 items in questi...more...
• 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: P3.0 (18-Jul-19)
#85585
PDF page: 149

In the text you use the name celegans_phenotypes and in the image you use the name celegans_markers--Juan de Souza

• 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: P3.0 (24-Jul-19)
#85607
PDF page: 180
Exercise 16, a) You say that the rat_1_weight contains the weight of the rat, it means that it is a variable that holds an integer, but in the answer...more...
• 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: P3.0 (22-Jun-18)
#83291
PDF page: 226
• 216 observations_file = open('observations.txt') bird_to_observations = {} for line in observations_file: bird = line.strip() bird_to_observati...more...
• Reported in: P1.0 (03-Aug-18)
#83441
PDF page: 257

Figure 13 should be say insertion sort instead of selection sort.

• Reported in: P1.0 (02-Dec-13)
• Fixed: 25-Aug-17, awaiting book release
#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...
Jennifer Campbell says: Thanks for reporting this. We've fixed it in the upcoming third edition.
• 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!