By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
71 | TYPO | >>> len(‘\\’) (first example of escaping) is syntactically incorrect. Was probably supposed to be in double quotes. | 2013-03-05 | ||
13 | TYPO | 1.2 1.3 | 2013-03-05 | ||
6 | TYPO | The web address in the installation instructions points to prag-prog.com instead of pragprog.com, i.e. there is an extra hyphen. | 2013-03-06 | ||
6 | SUGGEST | >>>As a real-life example of this kind of bug, the calendar program that one of the authors uses has a friend who was born in 1978. <<< The calendar program has a friend? | 2013-03-06 | I wish there was an upvote button. Nice find. :-) | |
92 | TYPO | ‘Return True iff x is positive.’, it should be | 2013-03-19 | ||
109 | TYPO | >>> type(math) but I type that shell on my computers, it should be as follows. | 2013-03-19 | ||
22 | 13 | SUGGEST | Second version. I want to add some explanation to get a better understanding My suggestion: DividendDivisorQuotient_Remainder Freepascal and Delphi work like this. But this cause a lot If you have a clock at 9.00h, what is the time 24 hours The answer is: –15 % 12 To solve this kind of bug, the majority of the programming DividendDivisorQuotient__Remainder _ 17 17 1_ 0 And with Python you will get the good answer: What is important to remember: —Python takes the floor of the result of an integer —Exception if your remainder is 0, the result is not —When using modulo,the sign of the result matches the Remark: My referance is: fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration) Thank you, Michel Lemay. PS: The line in the tables and other places is only to get the | 2013-07-08 | Thanks for the feedback! I'm glad you enjoyed the Coursera course! |
146 | TYPO | ‘In the code that follows, a list is created andstored in a variable;’ should be | 2013-03-19 | ||
169 | TYPO | ‘but but this one uses break to terminate execution of the loop’ should be | 2013-03-19 | ||
123 | TYPO | Here’s a piture of what happens when we do this This should be “picture”. | 2013-03-19 | ||
127 | TYPO | >>>9. Variables season refers to ‘summer’. Using string method format and the variable season, write an expression that produces ‘I love summer!’ Should be ‘variable’, singular. | 2013-03-19 | ||
127 | TYPO | >>>10. Variables side1, side2 and side3 refer to 3, 4, and 5, respectively. Using string method format and those three variables, write an expression that produces ‘The sides have lengths 2, 3, and 4.’ The variables don’t match the output expected. | 2013-03-19 | ||
203 | TYPO | ‘After we do this analysis, we will see that we can can search a sorted list’ should be | 2013-03-19 | ||
208 | TYPO | ‘some some programmers dislike returning in the | 2013-03-19 | ||
136 | TYPO | >>> A lists has a type, and Python complains if you use a value of some type in an inappropriate way. lists -> list, singular | 2013-03-19 | ||
139 | TYPO | >>> In the code that follows, a list is created andstored in a variable andstored -> and stored, need space | 2013-03-19 | ||
140 | SUGGEST | Do the list methods clear() and copy() exsist? | 2013-03-19 | ||
72 | TYPO | 7. Following the Function Design Recipe, define a function that has four | 2013-03-19 | ||
72 | ERROR | question 10 - weeks_elapsed(20,3) - wouldn’t day1 be before day2 thus making the 3 refer to day 3 of the following year and the expected result being 49 not 2? | 2013-05-16 | ||
111 | ERROR | The code for baking.py runs fine, but fails doctest because you use “return” for the results rather than “print.” As a result the test program produces the example between quotation marks, and therefore does not match the example you give. This may be an error in doctest rather than in the actual code. I just wanted to point out that the test fails. | 2013-03-23 | ||
129 | TYPO | in method swapcase: charaters | 2013-03-23 | ||
166 | TYPO | Rogue sentence in paragraph describing ‘while’ loop: If that expression is false, Python skips the it evaluates the expression. | 2013-03-24 | ||
194 | TYPO | Black text of question 10 has a word missing and (probably) a mis-spelling of dictionaries. | 2013-04-17 | ||
233 | TYPO | Chapter 9 title is “Desiging Algorithms” instead of “Designing Algorithms” | 2013-04-17 | ||
182 | TYPO | Second paragraph of text: “…Python has a for loop that lets YOUR process each element…” Should be YOU | 2013-04-17 | ||
201 | TYPO | Chapter title is misspelled. Desiging Algorithms | 2013-04-17 | ||
78 | TYPO | Right at the bottom of the page: output of running this program and is in bold and purple when it shouldn’t because it is inside the string which is being printed. | 2013-05-16 | ||
154 | TYPO | Under Processing Parallel Lists Using indices: Original: Should be: | 2013-04-17 | ||
168 | TYPO | After the definition of remove_neg(num_list) Fuction Original: Should be: | 2013-04-17 | ||
47 | 39 | TYPO | 4th para - The function body is indented. Here, we inded - should be .. we indent | 2013-04-17 | |
290 | TYPO | Unit test example. Chapter 15 | 2013-04-17 | ||
260 | TYPO | make sure you test all all of them you have 2 “all” words. | 2013-04-17 | ||
76 | TYPO | If you are expecting the user to enter a number, you must use function int or float to convert get an integer or floating-point representation of the string: | 2013-04-17 | ||
83 | TYPO | Similarly, evaluation of b2 and not b1 will produce True if b2 is True and b1is False. should have a space after last b1 | 2013-04-17 | ||
64 | OK | The function call should be: | 2013-04-17 | The function call parses fine as-is. Your suggestion gives the following error:
\n
\n>>> round(max(5.572, 3.258), abs(-2)))
\n File " | |
249 | SUGGEST | It may be nitpicking, but in talking about test cases you write “There are millions of numbers to choose from…” and (two paragraphs later) “We chose that value from among the billions of…” Which is it? Or is it that one could chose from an infinite number of values? | 2013-05-16 | ||
156 | OK | table doesn’t print correctly need to add a print() after the ‘for j in numbers:’ loop ends. def print_table(n): # Print the header row. # End the header row. # Print each row number and the contents of each row. # End the current row. | 2013-04-17 | The code included with the downloads prints the table fine as-is (loop/multiplication_table.py). In the code you posted, the last two lines aren't indented far enough. Maybe it was a copy/paste error? | |
262 | TYPO | Hi I think that when you define the repr method for atoms , the return statement should be return ‘Atom({0}, “{1}”, {2}, {3}, {4})’.format( and not return ‘({0}, “{1}”, {2}, {3}, {4})’.format( Thank you | 2013-05-16 | ||
204 | OK | “a for loop over the indices” seems to be repeated. 2nd paragraph, 2nd sentence. | 2013-05-16 | The phrases are slightly different: "a for loop over the **values**, a for loop over the **indices**". | |
36 | ERROR | braket for conversion to celsius in the programme is in wrong position giving wrong answer!7.12… mins instead of 7.8… mins. The statement at the top of the page 5/9*f - 32 is also wrong. Should be 5/9*(f-32) | 2013-05-16 | ||
14 | TYPO | In section “1.2 What’s a Programming Language?”, the language is Portuguese, not Portugese. | 2013-05-16 | ||
14 | TYPO | In section “1.2 What’s a Programming Language?”, it is written “exmaple” instead of “example”. | 2013-05-16 | ||
58 | TYPO | line 1 on page- second test is wrong. should be third test | 2013-05-16 | ||
141 | SUGGEST | “The same is true for methods clear,…” | 2013-05-16 | ||
168 | TYPO | Page 168, exercise 11, line 4 of docstring should read’remove_neg(numbers). ‘n’ in neg is typed ‘r’ | 2013-05-16 | ||
23 | SUGGEST | Hi, the text states that installation instructions are available at the URL http: //pragprog.com/titles/gwpy2/practical-programming | 2013-07-31 | We'll be adding those instructions before the book is in its final form. | |
183 | 176 | TYPO | There is typo in foot note at the bottom. This is the actual sentence in book, I think you mean to say “not” instead of “note” in above sentence. | 2013-07-06 | |
254 | ERROR | in function find_largest() , return statement is wrong: return copy[n:] | 2013-07-06 | ||
28 | TYPO | In the “Warning:= is not equality in Python!” box. | 2013-07-06 | ||
29 | 19 | SUGGEST | from regular integers Please avoid using the American expression “regular” to mean normal. In this case the word seems redundant (as it mostly is when this word is used by Americans). Thank you | 2013-07-06 | |
35 | 25 | SUGGEST | “two kinds of errors in Python” >> there are two kinds of errors in Python | 2013-07-06 | |
47 | 28 | SUGGEST | (as a reminder, focus only on the last line for now): As we have not been told this before, it cannot be a reminder. | 2013-07-06 | |
39 | TYPO | as the Python style >> as the Python style {Apologies for getting PDF Page numbers incorrect in previous posts. ) | 2013-07-06 | ||
51 | SUGGEST | If the answer is “both integers and floating- {Is it possible you have the above two lines in the wrong order?} | 2013-07-06 | ||
vii | TYPO | Missing from Contents listing: | 2013-08-07 | ||
90 | TYPO | >>> ‘A’ in ‘abc’ Context - Just prior to section 5.2 Operator in produces True exactly when the first string appears in the second string. This is case sensitive: | 2013-08-07 | ||
96 | SUGGEST | Context: Equivalence of Comment pdf page 94 noted this exception Suggestion, on page 96 add this note | 2013-08-07 | ||
101 | ERROR | Question 11 asks why the last example on page 97 checks to see if someone is heavy. But the example code on page 97 has an assignment 11. Why does the last example in Section 5.4, Remembering Results of Boolean Expression Evaluation, on page 97 check to see whether someone is heavy (that is, that their weight exceeds the threshold) rather than light? If you wanted to write the second assignment statement as light = bmi < 22.0, what change(s) would you have to make to the lookup table? Code from the end of page 97 (using boolean variables to remember the result of a comparison) The expression bmi < 22.0 is used multiple times. To simplify this code, we can evaluate each of the Boolean expressions once, create variables that refer to the values produced by those expressions, and use those variables multiple times: young = age < 45 Comment | 2013-08-07 | ||
101 | ERROR | ‘A’ in ‘abc’ | 2013-08-07 | ||
166 | ERROR | Minor technical error: bacteria are individual cells, not fractions. The answer 2143.5888099999997 cannot be correct. Of two possible fixes - use int or round of the added population - I lean towards the round solution The program as written: Suggested change to the line immediately follow the while statement Alternatively, just round the result, and add a comment about significant figures in experiments and computer simulations. | 2013-08-07 | ||
167 | SUGGEST | Loop until the user enters quit Context Could allow for user typing Quit or QUIT or perhaps with CAPS LOCK key text = “”
Suggestion 2: | 2013-08-07 | Nice -- we've added the exercise. | |
104 | TYPO | bottom of page | 2013-08-07 | You may need to paste the example one line at a time into IDLE. IDLE automatically indents the first line of a block (e.g. after a "def", "if", "elif", etc). So when you paste in the "elif" line, you need to remove the indentation first, then paste. Hope this helps! | |
179 | TYPO | Missing a name for the short program created in IDLE to read a file 4. In IDLE, select File -> New Window and type (or copy and paste) this program: Change line 5 to something like this | 2013-08-07 | ||
183 | ERROR | Context: discussion of \ Current text Problem My observation: A reference back to 7.3 is a great suggestion; many of the string methods provide exactly what you need when processing text file strings. Recommendation. Just refer the reader back to section 7.3 - Many of the string methods from section 7.3 will come in handy when processing strings from text files. | 2013-08-07 | ||
204 | TYPO | Exercise 5 - word ‘it’ omitted Current Change to add ‘it’ before ‘can handle’ | 2013-08-07 | ||
216 | ERROR | Context: explaining how tuple assignment allows a swap of variables One of the most common uses of multiple assignment is to swap the values of two variables: Sentence fragment instead of explanation. I’d say something like This works because assignment evaluates all the expressions on the right side of the = first (imagine them assigned to temporary variables _temp1 and _temp2), then assigns those results to the variables on the left of the = (s1 = temp1, then s2 = temp2). Result: variables get swapped. But any explanation (or removing the sentence fragment) should fix it. | 2013-08-07 | ||
90 | SUGGEST | When requesting to enter a date in the format DD MM YYYY, one could expect an answer like 24 02 2013 instead of 24 Feb 2013 like given in the book. MM stands for 2 positions. But it’s maybe a local cultural difference :-) | 2013-08-07 | ||
90 | ERROR | WHERE Near end of section 5.1 The in operator produces True exactly when the first string appears in the second string. This is case sensitive: ISSUE ‘A’ in ‘abc’ produces False FIX Change True to False in second example ‘A’ in ‘abc’ | 2013-08-07 | ||
35 | SUGGEST | The examples in 3.2. Add note to indicate that the answer to ‘Let’s try it:’ (object’s memory address) will probably be a different address. | 2013-08-07 | ||
36 | TYPO | Last line " (focus only on the last line for now):" The example referred to is the FIRST line. | 2013-08-07 | ||
24 | ERROR | 2.6 examples of line-continuation. The line ‘triple-dot’ prompt does not appear in Python 3.3.2 Shell: Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) | 2013-08-07 | This seems to only happen in IDLE. If you run the Python shell outside IDLE, those dots don't appear. Hmm... | |
37 | SUGGEST | Paragraph 3. | 2013-08-07 | ||
62 | SUGGEST | Introduction of “!=” in example: Precondition: n != 0 Not is Index as symbol. Indexed as “Not operator”. Defined in text at page 84. I suggest you add it to the Symbols in index and add note at the example. | 2015-11-04 | ||
32 | TYPO | end of line 5, beginning of line 6: the word Python is repeated. | 2015-11-04 | ||
11 | ERROR | “For the mathematically inclined, the relationship between // and % comes from this equation, for any two numbers a and b: Insert “non-zero” between “two” and “numbers”, for when b = 0, a divide-by-zero error occurs. | 2015-11-04 | ||
70 | TYPO | line 4 of the text reads: “using the *operator” — there should be a space after the “*”. | 2015-11-04 | ||
71 | TYPO | Lines 4 and 5 explain that single quotes can be used for strings containing double quotes. Then lines 6 and 7 repeat that. | 2015-11-04 | ||
72 | TYPO | Line 10 of the text contains: “Python creates contains a \ | 2015-11-04 | ||
76 | SUGGEST | Line 1 of the text starts: “In an earlier chapter, we explored some built-in functions.” For clarity should read “In chapter 3, we explored some built-in functions.” | 2015-11-04 | ||
51 | TYPO | There are 2 instances where the text in step “4. Description” doesn’t match the text in step “5. Body”. First, the latter ends with “which are” instead of with the word “both”. Second, the remainder of the sentence should be on the second line instead of passing “year).” to a third line. Defining the function with the docstring as it appears in “4. Description” returns the text as shown on page 51, after calling help on function “days_difference”. | 2015-11-04 | ||
85 | TYPO | In the example at the bottom of the page the 5th to last line reads: “Return True iff x is positive.” This should be “Return True if x is positive.” Author note: iff stands for “if and only if”. | 2015-10-16 | ||
92 | TYPO | Last line of last example on page reads “print ”You should be careful with that!“” | 2015-11-04 | ||
90 | TYPO | In the second code example on the page: >>> ‘a’ in ‘abc’ The correct code should be: | 2015-11-04 | ||
90 | ERROR | The section describing the IN operator uses an example meant to illustrate the case sensitivity of the operator. However the example is wrong: >>> ‘A’ in ‘abc’ If IN is case sensitive then the result of this example should be “false”. Running it in IDLE definitely shows a result of false as would be expected. | 2015-11-04 | ||
111 | ERROR | The second to last code snippet on the page reads: print(“After import, name is”, name, \\ The escape character at the end of line 1 is not required because of the surrounding parenthesis. | 2015-11-04 | ||
121 | TYPO | “Here are two more examples, this time using the other two string methods Should be page 120. | 2015-12-01 | ||
122 | ERROR | The code snippet at the top of the page: >>> help(math.sqrt) should be prefixed by: >>> import math to get it to work. | 2015-11-04 | ||
125 | TYPO | The line: “functions” should be replaced by “methods” | 2015-11-04 | ||
90 | TYPO | About mid-page, example reports that the phrase, or whatever I should call it, ‘A’ in ‘abc’ is True. This violates the case sensitivity of things, and anyway, I get False when I run it. | 2015-11-04 | ||
96 | SUGGEST | I see that someone has already discussed this, but wouldn’t it be better the replace the phrase “This code is the same as this:” with “is equivalent to” ? Maybe too picky? | 2015-11-04 | ||
90 | TYPO | as printed: >>> ‘A’ in ‘abc’ should be: >>> ‘A’ in ‘abc’ | 2015-11-04 | ||
97 | TYPO | Isn’t a colon missing in the first occurrence of “else” in the code at the bottom of the page? | 2015-11-04 | ||
89 | TYPO | Comparing Strings. 65 and 32 are decimal but the 172 is the octal for ‘z’, should be 122. | 2015-11-04 | ||
146 | TYPO | In the box “Where did my list go?”: “As we will discuss in Section 6.3, Testing Your Code Semiautomatically, on page 114” should be: “As we did discuss in Section 6.3, Testing Your Code Semiautomatically, on page 114” | 2015-11-04 | ||
28 | SUGGEST | Fourth bullet point - It may be helpful to clarify the second sentence by explaining that the variable will now point to the new value. | 2015-11-04 | ||
90 | TYPO | […] This is case sensitive: is: should be: | 2015-11-04 | ||
32 | TYPO | “…refers to 10, Python Duplication of the word Python | 2015-11-04 | ||
28 | 28 | TYPO | “Variables must be assigned values before they can used in expressions.” the word “be” is missing | 2015-11-04 | |
90 | ERROR | The in operator produces True exactly when the first string appears in the ## second entry should read false | 2015-11-04 | ||
177 | TYPO | In the last paragraph before 10.1: “You’ll first learn how to open and read information from files. After that, you’ll learn about the different techniques for reading files,…” Shouldn’t that be “different techniques for writing files,…” | 2015-11-04 | ||
178 | TYPO | In the penultimate paragraph: “calendar programs read and process ical files (),” ical should be iCal and the “()”? | 2015-11-04 | ||
180 | TYPO | First line of second paragraph: “The second statement, contents = example_file.read(), tells Python that you want” should read: “The second statement, contents = file.read(), tells Python that you want” | 2015-11-04 | ||
180 | TYPO | First line of third paragraph reads: “The last statement, example_file.close(), releases all resources associated with” and should be: “The last statement, file.close(), releases all resources associated with” | 2015-11-04 | ||
187 | TYPO | Section 10.4: all references to “urllib.urlrequest” are incorrect. The correct module name is “urllib.request”. | 2015-12-01 | ||
180 | ERROR | 2nd paragraph. The statements in the text a wrong. they are not the statements in the example. | 2015-11-04 | ||
183 | ERROR | A call to function sum_number_pairs results in a TypeError. And before that module total needs to be imported. [ Author note: In the paragraph before the function definition of sum_number_pairs, we mention that this code is saved in total.py. Once total is imported, the code works as shown. ] | 2015-11-04 | ||
185 | TYPO | In the first paragraph, the line: “programs using import tsdl, as shown in the next example. This allows us to” should import time_series | 2015-11-04 | ||
189 | TYPO | Top of page: “We now face the same choice as with skip_header: we can put find_largest in a module (possibly tsdl),” The module name is “time_series” not “tsdl”. | 2015-12-01 | ||
190 | TYPO | First paragraph: “here is the same code without using tsdl.skip_header and find_largest as helper methods:” should be “time_series.skip_header”. This error occurs throughout this section. | 2015-12-01 | ||
193 | ERROR | In example at the top of the page, file “multimol.pdb” is not closed. | 2015-12-01 | ||
110 | TYPO | The whole of section 6.3 has an issue where the text refers to module temperature_program, which has 3 doctests, but the screenshots show the outcome of running doctest.testmod on module baking, which has 1 doctest. | 2015-12-01 | ||
65 | SUGGEST | Nowhere in the description of strings is it mentioned that a string is a list of characters and that each character can be accessed by its index. I found this baffling when later strings were subscripted and looped over. Thanks to the Coursera forum I stumbled on the explanation. [ Author note: The for loop over strings is introduced in section 9.2, but that section makes no mention of indices, because they aren’t used by the for loop. String indexing is briefly discussed in section 11.2. ] | 2015-11-04 | ||
140 | TYPO | First paragraph: all references to “celegans_phenotypes” should be “celegan_markers”. | 2015-11-04 | ||
171 | SUGGEST | Throughout the examples in this chapter newlines are removed using str.strip(). However in the Coursera course in the week 6 files exercise this is marked incorrect and str.rstrip(’\ Author note: thanks for pointing this out. It is something to consider for the next edition. | 2015-12-01 | ||
186 | ERROR | In function definition smallest_value_skip there is no check for a ‘-’ in the first data line after the header. | 2017-08-12 | 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. | |
185 | ERROR | The type contract for function definition smallest_value is incorrect as it returns an int. | 2015-11-04 | ||
186 | TYPO | The type contract for function definition smallest_value_skip is incorrect as it returns an int. | 2015-11-04 | ||
196 | ERROR | Not so much an error as a redundant check in function definition read_molecule: if fields[0] == ‘ATOM’: is redundant as with the format of the data file if not at the end of file and not at a new molecule the only other kind of line is a line that starts with ‘ATOM’. Author note: Good point. Leaving it as is for this edition. | 2015-12-01 | ||
12 | TYPO | The operator for type is not listed under section 2.3. Instead the operator * is listed twice. | 2015-11-04 | ||
94 | TYPO | In the docstring “Return True iff x is positive,” there’s an extra “f” Author note: iff stands for “if and only if”. | 2015-10-16 | ||
225 | TYPO | 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. | 2017-08-12 | Subtle point but valid! Very nice catch. We've updated the short description and the comments in the code in the upcoming third edition. | |
224 | TYPO | At the bottom of the page: The type of the list in int not float. This error continues through all the examples in this section. | 2015-12-01 | ||
230 | TYPO | Last example on page:
should be:
| 2015-12-01 | ||
233 | TYPO | In function definition: Author note: The period makes the number a float. I updated it to be 1000.0 | 2015-12-01 | ||
233 | ERROR | In the example on the page the file is opened for reading but never closed. | 2015-12-01 | ||
57 | TYPO | “2. Type Contract. The arguments in our function call examples are all inte- gers, and the return values are integers too,” The return value is an integer. | 2015-11-04 | ||
302 | TYPO | The test case pattern at the top of the page: been What is the “been” on the first line doing there? | 2015-11-04 | ||
304 | TYPO | Last paragraph on page: Following those steps, we created a variable, nums The variable in the docstring is “L” not nums". This error occurs throughout this paragraph. | 2015-11-04 | ||
239 | TYPO | Bottom of page: list[0:i] doesn’t contain value, and 0 <= i <= len(lst) should be: list[0:i] doesn’t contain value, and 0 <= i < len(lst) as i should be 1 less than len(lst) Author note: This is okay as is. In the body of the function, we do allow i to become equal to len(lst). | 2015-12-01 | ||
243 | TYPO | function definition “time_it” has the type contract: (function, object, list) -> number which should be: (function, list, object) -> number | 2015-12-01 | ||
260 | TYPO | The doctest for function definition bin_sort is incorrect as the function returns a sorted copy of the list. | 2015-12-01 | ||
174 | ERROR | (in “The with Statement” section) | 2017-08-10 | Thanks for this. We've addressed this as we write the third edition. | |
111 | TYPO | Figure 5 shows the IDLE results of running baking.py, but the text discussing this on page 110 and the start of text on page 111 talks about temperature_program.py: I think Figure 5 needs to be updated to refer to temperature_program.py Author note: related to #52967 | 2015-12-01 | ||
241 | TYPO | In the explanation of the function linear_search(), it says, “At the end, we return… len(list) if value wasn’t in list.”, but actually –1 is returned | 2015-12-01 | ||
287 | TYPO | The example method at the bottom of the page: def str(self): The type contract should be: “”" (Faculty) -> str | 2015-12-01 | ||
291 | TYPO | End of first paragraph reads: rewritten to return a Molecule object instead of a list of tuples: should be: rewritten to return a Molecule object instead of a list of lists: | 2015-11-04 | ||
343 | ERROR | The first line on the page: The Python equivalent is a type we haven’t seen before called bytes… This is incorrect. We were introduced to bytes on page 181, section 10.4: There’s a hitch: because there are many kinds of files (images, music, videos, text, and more), the file-like object’s read and readline methods both return a type you haven’t yet encountered: bytes. | 2015-11-03 | ||
360 | SUGGEST | 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 figure out for myself that there had to be a way to close something that had been opened. | 2017-08-25 | Thanks for reporting this. We've fixed it in the upcoming third edition. | |
328 | TYPO | First sentence of “Changing Colors”: Almost all foreground colors can be set using the bg and fg keyword arguments, respectively. Should be: Almost all foreground and background colors can be set using the bg and fg keyword arguments, respectively. | 2015-11-04 | ||
335 | TYPO | Last sentence before the code: accessed using self.state, and its controllers are the methods upClick and quitClick. the 2 method names are: up_click and quit_click | 2015-11-04 | ||
337 | TYPO | Question 5 states: In Section 3.4, Using Local Variables for Temporary Storage, on page 39, should be: In Section 3.3, Defining Our Own Functions, on page 35, | 2015-11-04 | ||
59 | ERROR | The first code example of section 3.7 reads: >>> 3 + 5 / abs(–2) When I type this into IDLE 3, the return value is 4.0, not 5.5. [ Author note: I believe this is correct as is. Please double-check that you are using Python 3 and don’t add any additional parentheses.] | 2015-11-04 | ||
85 | TYPO | The sentence ‘This is often referred to as or Python decides which string is greater than which by comparing corresponding characters from left to right.’ seems garbled. [ Author note: I agree. There are a couple of words missing, so we’ll try to correct this. Thanks.] | 2015-11-04 | ||
88 | ERROR | In the final example shouldn’t there be parentheses around the string to be printed? [ Author note: do you mean print(ph, “is basic.”)? If so, that’s fine as is. ph is a variable and the value it refers to will be concatenated with the string “is basic”. ] | 2015-11-04 | ||
233 | ERROR | sea_level_press = [] I keep on getting the following error: I have checked the data file and there are no extraneous spaces, etc. Yet I cannot get past this problem. Any suggestions? Author note: In a multiline file, all lines except possibly the last would have a newline character and that can’t be converted to an int. Try removing the whitespace from the end of the line like this: sea_level_press.append(float(line.rstrip())) | 2015-12-01 | ||
213 | TYPO | “key/value pair listed is ‘canada goose’: 71” should be, | 2015-12-01 | ||
371 | 367 | ERROR | 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 (P.24) is not listed. | 2017-08-11 | Nice catch! We've fixed this in the upcoming third edition. Thanks! |
246 | TYPO | " while if it is greater than j, we should move j down." should be (i think), “while if it is greater than v, we should move j down.” | 2015-12-01 | ||
246 | TYPO | ‘because L[i] isn’t included in the range; instead…’ should be (i think), ‘because L[m] isn’t included in the range….’ | 2015-12-01 | ||
248 | SUGGEST | code related to binary search, will not display output unless dockets.testmod() is enclosed in print (), i.e. Author note: It is not necessary to call on print. If tests fail, the output will be displayed. | 2015-12-01 | ||
220 | TYPO | 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, you should have - return name When called with least_likely({’neutron’: 0.55, ‘proton’: 0.21, ‘meson’: 0.03, ‘muon’: 0.07}) instead of getting ‘meson’ you get ‘muon’ 5. def least_likely(particle_to_probability): Return the particle from particle_to_probability with the lowest probablity. >>> least_likely({’neutron’: 0.55, ‘proton’: 0.21, ‘meson’: 0.03, ‘muon’: 0.07}) smallest = 1 for particle in particle_to_probability: return particle PS - Bought the book after the Coursera course (which was great). I have really been enjoying going through this book. | |||
350 | SUGGEST | for c in countries: [Author note: Yes, either approach would be fine.] | 2015-11-03 | ||
219 | ERROR | It’s most likely my error but when I run the first code under 11.3, “Storing Data Using Dictionaries”, the bird_counts[] list never populates. I ran it through the Python Visualizer and the code never runs past ‘found = False’. Is there something missing ??? Author note: It should be able to get past that assignment statement. I suggest checking the identation of the code. I’ll close this, but if you still have trouble, please consider posting your question to the forums. | 2015-12-01 | ||
1 | SUGGEST | Would it be possible or desirable to provide the Exercise Solutions in a PDF or some other easily printable form? | 2017-08-14 | 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. | |
81 | TYPO | “Return True iff x is positive.” - note extra ‘f’ in ‘if’. Author note: iff stands for “if and only if”. | 2015-10-16 | ||
257 | TYPO | Figure 13—First few steps in selection sort | 2015-12-01 | ||
126 | ERROR | This is not an error with the text, but an error with the exercise solutions at http: // pragprog (dot) com/wikis/wiki/PracProg2methods. Solutions for exercise 11 b and c read: Should be: The text asks for first and second occurrence of ‘2’ in ‘CO2 H2O’ (not ‘O’). | 2015-11-04 | ||
91 | TYPO | Throughout the text, chemical compounds that include oxygen (H2O, H2SO4, CO2, etc) are written with a zero instead of a capital letter O. For example: H20 should be H2O. This may be a bit nitpicky, since this is not a chemistry textbook. However, your examples and exercises involve finding occurrences of certain characters in these strings. | 2015-11-04 | ||
287 | TYPO | Variable paul = Faculty(‘Paul’, ‘Ajax’, ‘pgries@cs.toronto.edu’, ‘1234’) contains only string ‘Paul’, not ‘Paul Gries’ as suggested by the print(paul) command three lines below. | 2015-11-04 | ||
282 | TYPO | In the example at the bottom of the page, the ISBN of book_1 and book_2 are the same, so ‘==’ cannot distinguish between them. Assume this has been reported. | 2015-11-04 | ||
282 | TYPO | Previous submit not error, Sorry! | 2015-11-04 | ||
338 | ERROR | Dear Sir Author note: Your are quite right that there doesn’t seem to be a page 338. However, nothing seems to be missing. I’ll report this to our publisher. | 2015-11-03 | ||
26 | 12 | TYPO | => “For example, in type int, the values are …, –3, –2, Should read “+, -, , /, //, %, and*.” | 2015-11-04 | |
133 | SUGGEST | The bottom figure, the id2:str cell: “none” -> “neon” (Author’s Note: Actually, the cell id2 never changes because strings are immutable. So cell id2 gets unlinked from the list and nobles[1] now points to cell id8 —Jason) | 2015-11-04 | ||
137 | ERROR | Paragraph 4 - To remove Dpy and Sma, the list useful_markers has to be sliced differently: | 2015-11-04 | ||
137 | ERROR | Sorry, my mistake. Only now I read further. Slicing in p.137 is correct. | 2015-10-16 | ||
295 | 287 | TYPO | In both of the str functions defined on this page, a string with new lines between each piece of data is returned. However, the docstring shows that the result should be a string with a backslash between each piece of data. [Author note: Yes, there should be a newline character (\ | 2015-11-04 | |
11 | OK | 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 floats. Example: 30/11 is 2.72, its nearest whole number is 3, but 30//11.0 returns 2, the floor of 30/11 | 2017-07-21 | 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". | |
24 | OK | ((350-32) x (5/9)) /20 = 8.83333333333333 rather than 7.83333333333333 for oven-heating time. | 2017-08-10 | In the expression above, you forgot to subtract 20: \n>>> (((350-32) * 5 / 9) - 20) / 20 \n7.833333333333333 \n | |
24 | OK | Erratum submitted in error. (–20) missing from numerator which changes result from 8.833…. to 7.833…. My apologies. | 2017-08-10 | ||
103 | ERROR | I’m using PY3.5.2. | 2017-08-03 | 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. | |
111 | TYPO | 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 not the temperature program. | 2017-08-13 | Thanks for catching this! Yes, the figure doesn't match the text. We'll have this fixed in the next edition. | |
113 | TYPO | Figure 6—Failure Message for doctest is showing test result from the baking.py program and not the described temperature_program.py module. The explanation doesn’t match the figure either. It’s clearly just the wrong snapshot. | 2017-08-13 | Thanks for catching this one too! We'll have it fixed in the next edition. | |
183 | ERROR | 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 read input_file. with open(output_filename, ‘w’) as output_file: | 2017-08-10 | 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. | |
85 | TYPO | 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 says: One of the most common reasons to compare two strings is to decide which one comes first alphabetically. This is often referred to as or Python decides which string is greater than which by comparing corresponding characters from left to right. (italics mine) I believe there is something missing after “This is often referred to as…”. | 2017-07-26 | 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. | |
62 | TYPO | the first line: pie(0) should actually be `pie_percent(0)`. | 2017-08-10 | Thanks for this, we'll update this in the third edition. | |
76 | TYPO | In Chapter 4 - Working with Text Answer 5a and 5b rabbit has too many “b’s” | 2017-08-14 | Thanks for catching this! We've updated the solutions. | |
195 | 185 | TYPO | the return type for smallest_value should be changed to int, not NoneType, as there is an int value being returned | 2017-08-12 | Thanks for this, we've addressed it it the upcoming third edition. |
226 | ERROR | • 216 After executing the above code I’ve got just one bird - key , value - pair. | |||
10 | TYPO | 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 answers given are (17 - 10. and 17. - 10) which both equal (7.0) - I would think that the zero (0) after the decimal point would be gone instead of both equations equaling the same 7.0 answer. Should they both be 7? | |||
18 | TYPO | On page 18, first full paragraph, you state variable degree_celsius when it should be degrees_celsius as in the preceding examples. (degree_ vs degrees_) Yes - I am a retired Navy cryptographer so I do pick out even the smallest of things. | |||
257 | TYPO | Figure 13 should be say insertion sort instead of selection sort. | |||
107 | ERROR | 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 question 1, but there are 8 items in the book. | |||
149 | TYPO | In the text you use the name celegans_phenotypes and in the image you use the name celegans_markers | |||
180 | ERROR | Exercise 16, a) | |||
72 | 59 | TYPO | “Now open IDLE, select File→New Window, and type this program in. (Either that or download the code from the book website and open the file.)” What I think it should be is as follows: Now open IDLE, select File→New File |